Forum Discussion
Allowing managers access to list items
Whilst I'm not a massive fan of list item permissions, you could use the SharePoint REST API to assign permissions to the list item. Depending on how you get the manager, you could either get the manager claims information from the list (if you're capturing that as a piece of metadata) or you could call Get Manager (v2) from the Office 365 Users connector. Once you've got the manager information you could make a REST call to SharePoint to assign the permission. I did something similar in SPD workflows a while ago, so the same thing could apply here.
If you can let me know where you get the manager info from, then I'll provide a fully worked example.
- Blain HarrisonJul 09, 2018Copper Contributor
Hi Matt,
Thanks for your reply, any info you have or links would be great. The manager is assigned on the account in AD and sync'ed to office 365.
Thanks!
- Matt WestonJul 20, 2018Brass Contributor
Hi Blain Harrison, did you ever manage to implement this? I've blogged exactly how I did, so if you need a step by step guide, hopefully this should help.
https://mattwestonuk.wordpress.com/2018/07/20/using-microsoft-flow-to-secure-a-list-item-to-my-manager-and-i/
- Matt WestonJul 09, 2018Brass Contributor
Hi Blain
There is a plugin called Plumsail SP - Change SharePoint permissions which will do the job in a single step, but you'll need to put your hand in your pocket to buy the credits.
My preferred method, because I like doing it myself, is by following this blog: https://noellawlor.wordpress.com/2018/01/18/setting-sharepoint-item-list-permissions-with-flow/
The only difference that you should be aware of to make it match your scenario is that you can get the manager UPN by using the Office 365 Users - Get Manager (V2) action. I'm going to write up the example of giving your manager access as a blog and then I'll share that too.
This is quite similar to what I've previously done with SPD. I'm working through this example as well, but let me know how you get on with it.