You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There looks to be a few issues with this one. From a quick look at the code, it looks to be a different cause to #1206.
When attempting to delete a role assignment, a GET request is sent to attempt to get the assignment by ID, this is pointing to the wrong URL, which #1207 should resolve.
It also looks like the ID is not getting correctly substituted (and not caught at runtime like it is in #1206), causing a request to be sent without the ID, resulting in a 400 response:
The expression "Web/RoleAssignments/GetByPrincipal({PrincipalId})" is not valid.
Steps to reproduce
Add one or more role assignments to a site for custom SP groups.
Run below code snippet
Experience error
varroleAssignments=awaitcontext.Web.RoleAssignments.ToListAsync();foreach(varroleAssignmentinroleAssignments){Console.WriteLine(roleAssignment.PrincipalId);// just for the sake of reading the principal idawaitroleAssignment.DeleteAsync();}
Expected behavior
A valid DELETE request is sent, or valid request to the removeroleassignment endpoint, and the role assignment is correctly removed.
The text was updated successfully, but these errors were encountered:
JakeStanger
changed the title
Getting role assignment by principal ID generating invalid request
Deleting role assignment generating invalid GET request
Jun 15, 2023
@JakeStanger : thanks for raising this and for the PR to fix the issue. I've just merged the PR, will be part of the next nightly, hence I'll close this issue now.
Category
Describe the bug
There looks to be a few issues with this one. From a quick look at the code, it looks to be a different cause to #1206.
When attempting to delete a role assignment, a
GETrequest is sent to attempt to get the assignment by ID, this is pointing to the wrong URL, which #1207 should resolve.It also looks like the ID is not getting correctly substituted (and not caught at runtime like it is in #1206), causing a request to be sent without the ID, resulting in a 400 response:
Steps to reproduce
Expected behavior
A valid DELETE request is sent, or valid request to the
removeroleassignment
endpoint, and the role assignment is correctly removed.Environment details (development & target environment)
The text was updated successfully, but these errors were encountered: