« Back to Product

Documentation

IPS_RemovePermissionFromRole

 bool IPS_RemovePermissionFromRole (string $Role, int $ObjectID, string $Operation, bool $Recursive) 

Parameters

Role

Name of the role

ObjectID

ID of the object the permission applies to

Operation

Name of the operation, e.g. VISUALIZATION

Recursive

Specifies whether the permission also applies to all objects below ObjectID (TRUE) or only to the object itself (FALSE)

Returns

If the function succeeds, it returns TRUE, otherwise FALSE.

Description

The function removes the permission to perform Operation on the object ObjectID from the role Role. ObjectID, Operation and Recursive must exactly match the permission added with IPS_AddPermissionToRole (see IPS_GetRole), otherwise the function fails with "Role does not have this permission".

Operation must be an operation registered in the system, otherwise the function fails with "Cannot verify unsupported operation". The operation is case-sensitive. Currently there is the operation VISUALIZATION (access to a visualization with all its objects). It is registered as soon as a visualization instance (e.g. Tile Visualization) exists and is checked against the ID of the visualization instance.

The checks are performed in this order: operation, role ("Role with name '…' does not exist"), object ("Object #… does not exist").

The executing user must be an administrator (see IPS_IsAdministrator), otherwise the function fails with "Administrator permissions are required for this action!".

Warning

Role management is only available with a license that includes the RBAC feature. Otherwise the function fails with "This function is only available for licenses with the RBAC feature enabled!". If more users exist than the license allows, the function fails with "Your license is currently limited to … users. Please consider upgrading the license to more users!".

Example

// The role may no longer open the visualization with the ID 12345
IPS_RemovePermissionFromRole('Residents', 12345, 'VISUALIZATION', false);
Any questions?