One of the things I frequently perform is copying the path of a file in a SharePoint library, not creating a link via the ‘Share’ menu.
There is a copy path icon in the details section of the file in SharePoint.
There is however one annoying caveat for this function. It is always beneath the ‘Activity section’, which on a file with a lot of activity is constantly loading. This makes the ‘Copy path’ option always move down right before I manage to click on it.
I was in the process of learning to build webparts for SharePoint. So I ended up writing an extension that adds a ‘copy path’ option to the menubar of the document library.
Afterwards you can paste the link from your clipboard! 🙂
When working with SharePoint you might have a situation in which you’ve assigned permissions to another user. But what if you want to reset this change using a Power Automate flow?
You could remove the permissions on the object with the build in Power Automate “Stop sharing an item or file” function. But if you do this all permissions of the item will be gone.
What we want is for the object to inherit the permissions of its parent. There is (as far as I’ve seen) no Power Automate function which allows us to do this. In the SharePoint API there is a function called ‘ResetRoleInheritance’ which does exactly what we want.
So what we can do is make a POST to the SharePoint API:
After running above command you will notice that the permissions of the item wil now no longer be unique and match the permissions of the list or parent.
There is a caveat. The above call will have an error if the item does not have unique permissions.
To avoid this we should verify first that the item is indeed using unique permissions. Once again we will need to use a function of the SharePoint api. Here we will call the ‘HasUniqueRoleAssignments’ function.