cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Deleting SharePoint Group from list item using HTTP request throwing error "Cannot find resource for the request role assignments."

Hi,

I am trying to delete permission of a SharePoint group from a list item using HTTP request. tried both steps in the screenshot below to see if one will succeed. 

Error : "Cannot find resource for the request role assignments."

 perm.jpg

 

@Pstork1 

Thank you in advance,  

4 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Assuming that permissions have been assigned to the SharePoint group the API you are looking for is

/_api/web/lists/getByTitle('List Name')/RoleAssignments/groups/RemoveByLoginName('SharePoint Group name')


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Solution Sage
Solution Sage

This HTTP request works fine for me, you're missing the '/web' part in your Uri.

 

_api/web/lists/getByTitle('<listName>')/items(<itemID>)/roleassignments(<groupID>)

 

image.png

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Are you sure the group is getting the permissions at the list level and not inheriting from the site?  If permission inheritance isn't broken then you can't remove the group's permissions from the list.  You would have to break inheritance first.  

Otherwise, with permission inheritance broken it works for me.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted

You're missing /web/ in Uri. The Uri on your screenshot:

_api/lists/getByTitle('<listName>')/items(<itemID>)/roleassignments(<groupID>)

The correct Uri:

_api/web/lists/getByTitle('<listName>')/items(<itemID>)/roleassignments(<groupID>)

 

View solution in original post

12 REPLIES 12
Highlighted
Dual Super User III
Dual Super User III

Assuming that permissions have been assigned to the SharePoint group the API you are looking for is

/_api/web/lists/getByTitle('List Name')/RoleAssignments/groups/RemoveByLoginName('SharePoint Group name')


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted

@Pstork1  Thank you Paul 🙏 for the swift reply, I will try it and let you know.

 

 

Highlighted

@Pstork1 

I tried it but it still give me the same error, I have double checked the group`s permission.

Highlighted
Solution Sage
Solution Sage

This HTTP request works fine for me, you're missing the '/web' part in your Uri.

 

_api/web/lists/getByTitle('<listName>')/items(<itemID>)/roleassignments(<groupID>)

 

image.png

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Are you sure the group is getting the permissions at the list level and not inheriting from the site?  If permission inheritance isn't broken then you can't remove the group's permissions from the list.  You would have to break inheritance first.  

Otherwise, with permission inheritance broken it works for me.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted

@tom_riha  I tried both but getting the same error 🤔perm2.jpg

@Pstork1  I added 

/items(<itemID>)

 

Highlighted

You're missing /web/ in Uri. The Uri on your screenshot:

_api/lists/getByTitle('<listName>')/items(<itemID>)/roleassignments(<groupID>)

The correct Uri:

_api/web/lists/getByTitle('<listName>')/items(<itemID>)/roleassignments(<groupID>)

 

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

At what level is the permission assigned?  Is it to the site, list, or list item?  Its a different URI depending on where you broke inheritance and assigned the permission.  Items/(ItemID) would be to remove permissions granted to the item.  Unless you've broken inheritance permissions are granted at the site level and inherited.  You can't remove inherited permissions.  I suspect the error you are getting is because you are trying to remove permissions at a level where they are inherited rather than assigned.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted

@Pstork1  The list have a unique permission and I am trying to remove the group permission from a list item.

I have a break inheritance action with copyRoleAssignments=true and that works fine, the item have a unique permission along with the Form Users group.

Highlighted

@tom_riha  I tried it with /web/ and still not working. I will create the flow from scratch and see if there is anything I am missing 

 

  • I have a break inheritance action at the top 
  • The list have a unique permission
  • I am trying to delete the group permission from a list item 
  • After the flow runs the item have unique permission, with the group I am trying to remove from the item

 

Highlighted

@Pstork1 

@tom_riha 

Thank you so much both , I created two flows from scratch and applied your suggestions in each and it worked in both. I don't know what the problem was previously.

I will mark it as solution. 

Perm_Done.jpg

 

Thank you so much for your help, you saved me from a headache and "pa panicking" 🙂 

Highlighted

@Pstork1 

Referring to the group by its name is easier & efficient than getting it by its ID. Thank you Paul. 

 

Perm-Final.jpg

 

 

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (8,699)