<< Click to Display Table of Contents >>
Navigation: Bizagi Studio > Security definition > Case Security >
Manage privileges through expressions
You can dynamically restrict access to specific cases or assign privileged users through Bizagi expressions (business rules executed during the process).
This section describes how to grant or revoke access to specific users by relying on the Case security feature.
Bizagi provides a set of functions to manage the privileged users list of open cases using an Expression.
These functions allow you to:
•Add a User
•Add a user list
•Remove a user
•Remove a user list
•Clear the access of a case
•Clear the access of a case list
•Get the privileged user list
Expressions to manage the Privileged user list
The following API is available from rules to manage the Privileged user list:
•CHelper.GrantCaseAccess(int idCase, int idUser): adds the user to the list of privileged users.
•CHelper.GrantCaseAccessToUsers(int idCase, Array Users): adds multiple users to the list of privileged users.
•CHelper.RevokeCaseAccess(int idCase, int idUser): removes a user from the list of privileged users.
•CHelper.RevokeCaseAccessToUsers(int idCase, Array Users): removes multiple users from the list of privileged users.
•CHelper.ClearCaseAccess(int idCase); removes all the users from the list of privileged users in a case.
•CHelper.ClearCaseAccess(Array idCases); removes all the users from the list of privileged users in a list of cases.
•CHelper.GetCaseAccessUsers(int idCase): gets the privileged user list.
These functions expects one or two parameters: the unique case identifier and users identifier.
•When the function receives one user, the user’s identifier must be entered.
•When it receives multiple users an array of user identifiers is required.
The identifiers are integers that are automatically created in Bizagi and are unique for each record. Therefore, each case has its unique identifier, as each user does. NEVER AND UNDER NO CIRCUMSTANCES type the integer or the identifier number in the expression as a fixed value. Bizagi provides a number of methods to obtain the IDs. For example, the method CHelper.getUsersForRole returns an array of user IDs belonging to a particular role.
To get cases identifiers we recommend these functions:
•Me.Case.Id, returns the case ID for the current case.
•CHelper.getSiblingProcessesId (Me, iWfClassId): returns an array of Sub-Processes case IDs, that are all created from the current Sub-Process’ parent Process.
•CHelper.getSubProcessesId (Me): returns an array of case’s IDs, that are all Sub-Processes of the current parent Process.
Examples of Case security using expressions
Refer to the following links to have examples of the available expressions to: