IsCurrentUserOrDeputy
Checks if user specified in first parameter is current user or deputy of current user.
Syntax
IsCurrentUserOrDeputy("user","[checkIfAdmin]");
Function arguments
- user – (String) Login of the user to be checked
- checkIfAdmin – (String) [Optional] If set to true then function will returns true if current user is system administrator
Return value
This function returns Boolean.
Returns true if current user is equal to user that is specified in parameter or current user is deputy of the user specified in parameter
Examples
Example 1:
Function will check if current user is user from Manager field or current user is deputy of the user from Manager field. This function call is equivalent of two conditions: CurrentUser()==[Manager] || IsDeputyOf(CurrentUser(),[Manager])
valid = IsCurrentUserOrDeputy([Manager]);
Example 2:
Function will check if current user is user from Manager field or current user is deputy of the user from Manager field or current user is system administrator
valid = IsCurrentUserOrDeputy([Manager],true);