Determine role of logged-in user

Determine role of logged-in user

Note: This task is applicable only to Zoho Creator.

Overview

This deluge task is used to check if the logged-in user belongs to a specified role or not. 

Return

This task returns boolean value 'True' if the logged-in user belongs to the specified role. Otherwise, it returns 'False'.

Syntax

<variable> = thisapp.permissions.isUserInRole( <Role_Name> );

ParamExplanation

<variable>

(optional)

Variable which will hold the returned value.

<Role_Name>

Name of the role to check if the logged-in user has been assigned to that role.

Points to note for this parameter:

  • If the specified role name does not exist, execution will be stopped during run-time and an error message will be displayed.
  • You can view the list of existing roles in your application in the Permissions page.

Data type is Text.

This task can be used in the following events

When a record is Created
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Created or Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Deleted
On ValidateYes
On SuccessYes
Other workflow events
On a scheduled dateNo
During approval processYes
During payment processYes
In a Custom FunctionYes
In an Action item in reportYes

Example

A sample snippet being used to determine if the logged-in user belongs to the "Manager" role.

boolVal = thisapp.permissions.isUserInRole("Manager");

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com