Big Idea or Enduring Question:
Permission Sets are helpful for providing a particular set of functionalities to a user in addition to the permissions provided by their Profile. For example, you may want to allow only a few of your sales users to convert leads. In this case, rather than having a special sales profile with the convert lead permission, you can create a permission set and assign it to a specific user. What if you only want a permission set assigned for a designated time and don’t want to forget to remove it later.
- Assign permission set for a specific time period 01-Jan-2022 to 15-Jan-2022 (Like you have defined start and end time)
- Remove permission set from user on 31-Aug-2021 i.e. future date
I have written a few articles on automating Permission Set and automation. Why not check them out while you are at it?!
- Getting Started with Salesforce Flow – Part 53 (Clone a User with their associated Public Group, Queue Membership, and Permission Sets)
- Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
After reading this article, you will be able to:
- Use Schedule-Triggered Flow to assign or remove permission set at specified date automatically
- Best practice to refer Permission Set into Record-Triggered Flow
- Use a Decision element to find – record variable or record collection variable contains a record or not
- Assign permission set to users on 1st day of the month
- Remove the permission set from the users on the 6th day of the month
- Monitor Schedule job flow queue
Business Use Case
Brenda David is a System Administrator at Universal Containers (UC). Management at UC has announced an initiative to allow their employee to update or delete vacation requests instead of sending a request via email to HR. To do this, users will need special permissions, like update or delete vacation requests (custom objects) that are outside their standard permissions. They should only have access from 1st day of every month to through 05th day of the month (Grant access for the first five days of the month).
Automation Champion Approach (I-do):
While this can be solved using various automation tools like Apex, etc, we will use Scheduled-Triggered Flow. Before proceeding ahead, you have to understand the PermissionSetAssignment object. Represents the association between a User and a PermissionSet. Below are the key fields from the PermissionSetAssignment object
|PermissionSetId||ID of the PermissionSet to assign to the user specified in AssigneeId.|
|AssigneeId||ID of the User to assign the permission set specified in PermissionSetId.|
Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it. Let’s begin building this automation process.