You need to sign in to do that
Don't have an account?
Crowdcast
You can't assign or unassign this permission set because it's associated with a profile.
I was previously able to delete PermissionSetAssignment through the REST API. Now I am getting:
You can't assign or unassign this permission set because it's associated with a profile.
I would think that I was doing exactly that - deleting the assignment to dissociate the profile from the PermissionSet. Any pointers?
thanks
yan at crowdcast dot com
You're going to have to navigate the PermissionSetAssignment object and remove all references to your target Permission Set before deleting. The delete does not cascade.
-Andy
This is a pretty old post, but I was searching for a resolution to the exact same error but couldn't find it anywhere, so I figured I'd put in what I found.
I was getting the exact same error though I was using apex instead of the rest api. Good chance it's the same issue though.
I was querying for all permissionsetassignments on a user record and attempting to delete the ones that didn't match.
There was one permissionsetassignment that was associated with a system generated permissionset rather than one of the ones I created. Since that one never matched any of the ones that I created, my code attempted to delete it. It was when my code was trying to delete this system generated permissionsetassignment that I got the errors.
Once I changed my select statement to not include the system one, I was no longer getting that error. While I don't know if this will help Crowdcast anymore since it's a post that's 6 months old, but hopefully can help out anyone else running into the same problems.
Just had the same issue with the system permissionset assignment, I solved it by inserting in my PermissionSetAssignment query a WHERE condition that would check if the PermissionSetId was the Id of a Permission Set that has the IsOwnedByProfile= FALSE. the system Permission Sets have that value as TRUE.
example query:
SELECT Id, AssigneeId, PermissionSetId
FROM PermissionSetAssignment WHERE
AssigneeId = :userId
AND PermissionSetId IN (SELECT Id
FROM PermissionSet
WHERE IsOwnedByProfile =false)];
Thank you guys, had the same issue, "PermissionSet.IsOwnedByProfile = false" worked for me.
Adding
AND PermissionSetId IN (SELECT Id
FROM PermissionSet
WHERE IsOwnedByProfile =false)
resolved the error.
That was very helpful thanks
But it isn't just the permission Set guys also the licensed one's
Here a quick Devconsole cleanup if it helps