Notes
Apex:
PermissionSet perSet = new PermissionSet();
perSet.Label = 'Delete Account Permission Set';
perSet.Name = 'Delete_Account_Permission_Set';
insert perSet;
Profile identityProfile = [SELECT Id FROM Profile WHERE Name = 'Identity User' LIMIT 1];
List<User> identityUsers = [SELECT Id FROM User WHERE ProfileId = :identityProfile.Id];
List<PermissionSetAssignment> assignments = new List<PermissionSetAssignment>();
for (User user : identityUsers) {
PermissionSetAssignment assignment = new PermissionSetAssignment();
assignment.PermissionSetId = perSet.Id;
assignment.AssigneeId = user.Id;
assignments.add(assignment);
}
insert assignments;
Flow Builder:
Video
Video does not exists.