I'm trying to create a flow to assign permissions to my site pages.
My scenario is I have a training site for all departments in my business. I am not using individual department sites because:
- Some pages come under a specific department, but are accessible to everyone.
- I'm using SharePoint Framework Apps to automatically add navigation because manually linking everything was a nightmare.
- I use a list to show up-to-date department teams on each page.
However, I have lots of pages that should only be visible to specific departments and I want to automate the permissions. So I need a flow that:
- Checks the existing permissions on the page vs. who should have access. I have a column that, if ticked, says the page should be restricted to only those people with the department ticked on my list, and, if unticked, says everyone should have access.
- Update permissions only if they don't match.
I know how to update the permissions (stop sharing an item or file + grant access to an item or folder works for my purposes), but I don't know how to go about checking if the permissions match so I'm not removing and recreating permissions every 5 seconds.
Any help would be greatly appreciated!
Edit for clarity on what columns I have:
My Site Pages library has the columns: Department (Choice) and Restrict (Yes/No), where the latter says only those that are a part of the department should be able to view this item.
My Users list has a Yes/No column for each department, where yes means they have access to that department's restricted content.

Report
All responses (
Answers (