I need to figure out if values in PermissionSet for current user are changed in trigger, i'm thinking about using oldMap but i can't figure it out.
Maybe this code will explain what i'm trying to do:
for (User u : trigger.New)
{
List<PermissionSetAssignment> isOldSetuplstOldPermSet = Trigger.oldMap.get(u.id).PermissionSetAssignments;
List<PermissionSetAssignment> isNewSetuplstNewPermSet = // get PermissionSetAssignments via soql query
if(isOldSetuplstOldPermSet != isNewSetuplstNewPermSet)
{
// code goes in here
}
}
Any suggestions?