Hi Team,
we have a requirement to check and update the site permissions.
In shortly: check if members group Role is having to contribute or not, if not update, then and check another Site group (GroupA) is having access or not, if not grant else skip.
here is the sample OutPut (Before)
Need to get SharePoint site Permissions (User.aspx)
As of now, the site is having in this way.
Members: Edit
Owners: Full control
Visitors: Read
This means it has to check on two groups and another one is on the role.
if
1. Members Grp Role is Edit then updated with Contribute
2. Members Grp role is already having to Contribute role then, no need to update members group just skip and check on GroupA site group
3. GroupA group is having site access or not, if not grant, else skip.
During checking/Condition
case1:
Members: Contribute
Owners: Full control
Visitors: Read
Here Members group is already updated, but GroupA is not having access.
Case2:
Members: Edit
Owners: Full control
Visitors: Read
GroupA: Read
Here GroupA group has access but the Members group role is not updated, hence it needs update Role only
Final OutPut
Members: Contribute
Owners: Full control
Visitors: Read
GroupA: Read
Kindly assist me here on how to apply condition to check
your POC to check the above condition would be appreciated.