For our user provisioning (from AD) I want to automate the permission set groups that are assigned to user with a specific function title. What I have found is how to assign a permission set using the Flow Builder (create a record in the object 'Permission Set Assignment'. But I have not been able to find the same for Permission Set Groups. Is this even possible?
1 Answer
Both PermissionSetAssignments and PermissionSetGroups are accessible as SObjects and can be created in the database when the appropriate permissions exist. I suggest you simply need to create the PermissionSetAssignment for the User referencing the PermissionSetGroup instance. This can be done straight-forwardly in Apex using something like:
PermissionSetAssignment assignment = new PermissionSetAssignment(
PermissionSetGroupId = groupId,
AssigneeId = userId);
insert assignment;
Of course, you should ensure this code is bulkified if you are handling bulk provisioning, and can be accessed from a flow as long as you create an InvocableMethod for it.
-
Thanks for the quick response! I'll let you know if this worked out. Commented Feb 27, 2020 at 7:43