nm_iam_check_access()
DESCRIPTION
Check if the given connection has access to do the given action. Configured IAM polices are evaluated in context of the connection and optional specified attributes.
In addition to the specified attributes, the IAM module add the Connection:IsLocal
as true
or false
based on nabto_device_connection_is_local()
. Some CoAP requests and TCP Tunnels may call this function. In those cases, the action and any additional attributes are documented there.
DECLARATION
bool nm_iam_check_access(struct nm_iam* iam, NabtoDeviceConnectionRef ref, const char* action, const struct nn_string_map* attributes)
PARAMETERS
iam:
- [in] IAM module to query
ref:
- [in] the connection to check
action:
- [in] the action to check if it is allowed
attributes:
- [in] optional attributes to reference from policies (can be NULL)
RETURNS
true if the requested action is allowed, false if not