Check if User is in a Group

Using Workflows, you can check to see if the currently logged in user is part of a specific group. For example, you may only want security staff to be able to unlock a specific door after an request to enter has been made.

Note: You can only check if the user is in a group if security is enabled for the project.

Before starting, you will need to find the ID for the security group.

In the below example, we have a door which is normally kept locked, and we only want security staff to be able to unlock it. The Start block is configured to trigger when a request is made to enter through the door.

  1. Add a Logic block then double-click it to open the Logic Browser.
  2. Click the HasItem button.
  3. In the Expression pane, select String Collection.
  4. Select User Security > Currently Logged In Users Groups then click OK.
  5. In the Expression pane, select String.
  6. Enter the ID of the user group and click OK. Click OK again.
  7. Drag and drop the False execution path from the right of the Logic block to the Stop block.
  8. Add an Action block and configure it to unlock the door.
  9. Drag and drop the True execution path from the left of the Logic block to the Action block.
  10. Connect the Action block to the Stop block.

When this is completed, the Workflow should look like this: