cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RMK
Frequent Visitor

How to delete Visitors group from new item?

Hi Dear Community!

Is it possible to delete only groups Visitors and Members from new item via automation? 

I can successfully do this only when deleting all direct access, including the provided users. I want to delete exactly two groups Visitors and Members.
If I provide direct access to the user, and after that the script runs, it deletes the user along with the groups.

 

However, if you grant access through a link, the script does not remove that access.

 

_api/web/lists/getByTitle('test2')/items(@{triggerOutputs()?['body/ID']})/roleassignments(4)

 

Screenshot_36.png

 

Thanks a lot!

1 REPLY 1
Expiscornovus
Super User
Super User

Hi @RMK,

 

Have you tried using different settings for breaking inheritance? It is possible to break it without copying the existing roleassignments.

 

This does mean that you have to add some roles after breaking inheritance, but it could be a workaround for your situation with the sharinglinks permissions.

 

_api/web/lists/getbytitle('Test2')/items(ID)/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)

 

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Users online (1,432)