Follow

Process permissions

Article last updated on the 6th of July, 2022.

Contents

1. Introduction

Sometimes it is important to control users' ability to run processes in WorkPoint.

An example could be if the ability to run a process to create new projects or cases in a WorkPoint solution only should be available to project- or case managers.

In this article we will discuss permission setups for processes.

2. Requirements

There are no requirements associated with the use of process permissions.

3. Configuration

   3.1. Permissions based on Azure Active Directory group

In this configuration example, we will set up a permission rule on a process, such that only users who are members of an Azure Active Directory group called "Managers" can run it.

To control who can run a process, we can set up permission rules in the settings of a process:

  1. To set up permissions rules for a process, click the "Settings" button in the open process.
  1. In the "Settings" panel, open the "Permissions" tab.

We can now create a basic permission rule to check if the current user who is trying to run the process is a member of the "Managers" Azure Active Directory group:

  1. In the "Type" field, we select "User or Group".
  2. Next, we click the "Value" field and in the browser pop-up, we search for the "managers" group.
  3. To select the "Managers" group, we click the search result.
  1. In the "Operator" field, we select "Contains", because we want to check if the "Managers" group contains the user we are about to define.
  2. In the "Target Type", we select "Context".
  3. In the "Target Value" field, we select the current user from the context, using the CurrentUser.UserPrincipalName variable.

Using this setup, the system will check if the user trying to run the process is a member of the "Managers" Azure Active Directory group.

If they are, they will be allowed to run the process. If they are not, a message telling them that they lack the necessary permissions to run the process will be displayed.

It is possible to add multiple permission rules:

WorkPoint Process Builder - Google Chrome
  1. To add additional permission rules, click the "Add More" button.
WorkPoint Process Builder - Google Chrome
  1. Use the "And" or "Or" operator to join the permission rules. "And" will require both rules to be true to allow running the process, while "Or" requires just one of the rules to be true to allow the process to be run.

   3.2. Permissions based on entity field

In this configuration example, we will set up permissions so that only users assigned to a field on an entity will be able to run a given process.

For this purpose, we are using a process which edits the meta data of a company, and the field we want to check for has the internal field name "wpResponsible".

Additionally, we will make use of adaptive expressions to accomplish this task.

We begin by opening the process settings:

WorkPoint Process Builder - Google Chrome
  1. With the process open, click the "Settings" button.
WorkPoint Process Builder - Google Chrome
  1. In the process settings window, open the "Permissions" tab and click "Advanced".

Now, we can type in an adaptive expression to check if the current user trying to run the process is assigned in the wpResponsible field.

First, we need to know whether the field we are checking, the wpResponsible field, allows multiple users to be assigned.

If the wpResponsible field allows multiple users to be assigned, we use the following expression to check if the current user is one of the assigned users in the field:

contains(string(Entity.wpResponsible),CurrentUser.Email)

If instead the wpResponsible field only allows single users, we use the following expression:

Entity.wpResponsible[0].email == CurrentUser.Email

These expressions check if the current user trying to run the process is assigned in the wpResponsible field. If they are, they will be allowed to run the process.

If they are not, they will instead receive the following message in the process window:

WORKPOINT A/S - Home - Google Chrome

In this instance, the wpResponsible field allows multiple users to be assigned, so we use the first expression:

We can now save and publish the process.

Let's take a look at one of our registered companies:

anm0023 - Companies - All Items - Google Chrome

This company has a single user assigned, Chris Butler.

If we log in as Chris Butler, we can run the process as normal:

  1. Note that we are logged in as Chris Butler, and that we are allowed to run the process.

If we instead log in as e.g. Edward Dean, we are not allowed to run the process:

  1. Note that we are logged in as Edward Dean, who is not assigned in the wpResponsible field, and therefore not allowed to run the process.

For demonstration purposes, let's assign assign Edward Dean to the wpResponsible field:

anm0023 - Companies - All Items - Google Chrome

Since Edward Dean is not assigned in the wpResponsible field, they are now allowed to run the process:

Have more questions? Submit a request