Users
Checking user permissions for an application or its features
To check if a user has access to perform certain action to an application or its features, check_permission
command can be used. The command takes the following parameters:
feature
: The feature path for which the permission needs to be checked. The feature path should consist of the application name and its subfeatures. It should be in the formatapp_name.subfeature1.subfeature2...
. Make sure to provide the feature path in quotes if any of the subfeatures or the application name contains spaces.action
: The action for which the permission needs to be checked. The action can be one of the following:read
orwrite
.auth_token
: The authentication token of the user for whom the permission needs to be checked. If theauth_token
is not provided, the command will use the token from the current session. Note thatAPI_KEY
cannot be used in this operation, instead, a user’sPersonal Access Token (PAT)
orBearer Token
should be used.
The command will return True
if the user has the permission to perform the given action on the given feature, otherwise it will return False
.
peak user check-permission --feature "SOME APP.SOME FEATURE" --action read --auth-token <your-auth-token>