« Back to Product

Documentation

IPS_RemovePermissionFromUser

 bool IPS_RemovePermissionFromUser (string $User, int $ObjectID, string $Operation, bool $Recursive) 

Parameters

User

Name of the user (case-sensitive)

ObjectID

ID of the object the permission applies to

Operation

Name of the registered operation, e.g. VISUALIZATION

Recursive

Must match the value the permission was added with

Returns

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

Description

The function removes the permission for the Operation on the object ObjectID from the user User. The combination of ObjectID, Operation and Recursive must exactly match a permission assigned directly to the user (see Permissions in IPS_GetUser). Permissions the user receives via roles are not affected.

Warning

This function is only available for licenses that include the RBAC feature (Permission Control). Otherwise it fails with "This function is only available for licenses with the RBAC feature enabled!". If there are more users than the license allows (10 users by default, the @admin user is not counted), it fails with "Your license is currently limited to 10 users. Please consider upgrading the license to more users!" (the number is the limit of the license).

The currently logged in user (see IPS_GetLoggedInUser) must be an administrator, i.e. the @admin user or a user with the @admin role. Otherwise the function fails with "Administrator permissions are required for this action!".

Further checks in this order: If the operation is not registered, the function fails with "Cannot verify unsupported operation". If the user does not exist, the function fails with "User with name '…' does not exist". The @admin user cannot be modified; trying to do so fails with "User @admin cannot be modified!". If the object does not exist, it fails with "Object #… does not exist". If the user does not have the permission, it fails with "User does not have this permission".

See also: IPS_AddPermissionToUser, IPS_RemovePermissionFromRole

Example

$VisuID = 12345; // ID of a tile visualization
IPS_RemovePermissionFromUser('anna', $VisuID, 'VISUALIZATION', false);
Any questions?