Update features assigned to a role
PUT
Sets the complete list of features (permissions) a role can access and returns the result. Codes must be allowed for the role on the merchant's plan. You can only grant features your own role holds, and cannot edit a role that has access beyond yours.
How to use it
- Call Get features assigned to a role to see allowedFeatures and the current assignedFeatureCodes.
- Send the full set of featureCodes the role should have; codes left out are removed.
- The call is refused if a code is not allowed on the plan, if you lack a code you are granting, or if the role has access beyond yours.
- Users with this role get the new permission set.
BearerAuthheader
AuthorizationBearer <JWT>id*integerID of the record.
Format
int64application/json- body
featureCodes*array<string>The complete set of feature codes the role should have; codes left out are removed. Each must be in the role's allowedFeatures.
updatedBy?|Name or username to record as having granted the new features.
OK
*/*- response
roleId*integerRole ID.
Format
int64roleKey*stringThe role's key, e.g. CASHIER.
roleName?|The role's display name.
allowedFeatures*array<>Features this role may be given on the merchant's current plan.
assignedFeatureCodes*array<string>Codes of the features the role currently has.
Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/management/roles/0/features' \ -H 'Content-Type: application/json' \ -d '{ "featureCodes": [ "string" ]}'Example Response
{ "roleId": 0, "roleKey": "string", "roleName": "string", "allowedFeatures": [ { "code": "string", "name": "string", "description": "string", "category": "string" } ], "assignedFeatureCodes": [ "string" ]}