« Back to Product

Documentation

IPS_UserIsAdministrator

 bool IPS_UserIsAdministrator (string $User) 

Parameters

User

Name of the user (case-sensitive)

Returns

If the user is an administrator, TRUE is returned, otherwise FALSE.

Description

The function checks whether the user User is an administrator. Administrators are the @admin user and every user that has been assigned the @admin role (see IPS_AddRoleToUser). For the special user @unknown the function returns FALSE.

If the user does not exist, the function fails with "User with name '…' does not exist". The function requires neither the RBAC feature in the license nor administrator permissions.

For the currently logged in user, IPS_IsAdministrator can be used.

Example

var_dump(IPS_UserIsAdministrator('anna'));

/* e.g. returns:
bool(false)
*/
Any questions?