So I made a workflow that creates a team, adds people to it, creates one folder for every user and is then supposed to give every user only access to their own folder and not the others.
I am using a HTTP request to first break inheritance on the folder, and then give the user permission with "Grant access to an item or folder". It actually looks like it should work. When I log into Sharepoint with my admin account and check the permissions for the folders it all looks exactly how it is supposed to. The problem is, as soon as I attempt to log in on one of the users, the permission is immediately removed. If I check again on my admin account, its just gone.
I can't explain why this is happening and hope maybe somebody has an idea and could help me. Thanks in advance.
Understood, yes of if user is deleted from Azure AD, then user will be removed from SharePoint. Generally it is a good practice to deactivate user from AD instead of deleting unless you have strong reason to delete..
I just figured out the problem myself. I kept creating Azure AD users with the same name every time I ran the flow and deleted them inbetween tests. It seems like that confused Sharepoint and it jumbled up user information and giving permission to either already deleted Accounts of the same name or possibly amalgamations of the deleted and the newly created accounts. When I choose a name for Azure AD that I have not used before (and add a delay to my flow), it works!
@Vaughn1234 so does the permission get removed when user tries to access the folder? I tried implementing your scenario and i didnt face the issue of permissions removed.
Yes no problem. First one is before logging in, 2nd one after
EDIT: The problem also persists when I create a new library and create the folder there instead of using Documents
@Vaughn1234 On manage access section you will see Advanced link at the bottom can you check the permissions on that page as well.
Yes exactly. The account has access to the folder until the moment I log in with it. And yes, I was waiting for the flow to be completed.
In the screenshot you can see me get the metadata of the folder to retrieve the ItemId. Then I break inheritance from the library with the HTTP request. After that I grant access to the folder to the correct account. I loop through this multiple times but the behavior is the same whether I do it once or multiple times
@Vaughn1234 so that user to whom you are assigning permissions from flow using grant permission got removed? Can you also share the screenshot of the flow with actions expanded? Are you waiting for flow to complete before checking the permissions?
Yes of course.
Screenshot by Lightshot (prnt.sc)
This is before I log in on the account that has permissions and this:
Screenshot by Lightshot (prnt.sc)
is after.
@Vaughn1234 the permissions shouldnt get automatically removed, thats not how SharePoint works, can you share the screenshots of permissions page logged in with admin before you are logged in with other user and then logged in with admin after you are logged in with other user?
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional