How to retrieve the effective permission of a file or folder?

Giovanmaria Scanu 0 Reputation points
2024-03-20T08:04:24.7633333+00:00

I do need to verify from the API if a User has the correct permission to create a new file into a folder or to modify it whether is OneDrive or Sharepoint, the granularity of the permission is giving me an hard time, having multiple layer from where to inherit, which might not be given in the response in specific environment, here an example:

{            
	"@deprecated.GrantedTo": "GrantedTo has been deprecated. Refer to GrantedToV2",            
	"id": "id",            
	"roles": [ "write"],            
	"shareId": "id",            
	"grantedToV2": {                
	"siteGroup": {                    
	"@odata.type": "#microsoft.graph.sharePointIdentity",                    
	"displayName": "Site Members",                    
	"id": "5",                    
	"loginName": "Site Members"                
}            
},            
	"grantedTo": {               
	 "user": {                    
	"displayName": "Site Members"                
}            
},            
	"inheritedFrom": {}        
}

As you can see this is a part of a sample response from the a item from sharepoint where the users included in that group have write permission, but the id cannot be used to the API ( Post https://graph.microsoft.com/v1.0/me/checkMemberGroups ) and find your presence into that group.

Could you help on how to find the correct combination of calls to find the effective permissions of an user?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,446 questions
0 comments No comments
{count} votes