User Profile
ahmed-adel-9
Copper Contributor
Joined Feb 12, 2023
User Widgets
Recent Discussions
Right User Permissions to use ListItem.GetUserEffectivePermissions method
I'm currently using a SharePoint account as a Service account to get files and share them in an application I'm working on using CSOM. I filter the files according to the logged-in user to check if the user has no access to the file, then I hide it, to prevent him from trying to access it and get "Permission Denied" error. So, I used ListItem.GetUserEffectivePermissions for this issue, but I need to grant the user only the permissions he needs to access and make that check. I checked the official documentation of ListItem.GetUserEffectivePermissions https://learn.microsoft.com/en-us/previous-versions/office/sharepoint-csom/ee536458(v=office.15) but unfortunately, I found no direct clue which permission does the job. So to recap what this service account needs to do is : Execute Search across all sharepoint files [SearchExecutor]. Get Login Name by Email using Utility.ResolvePrincipal (to be used in GetUserEffectivePermissions function). Use GetUserEffectivePermissions to check if the logged-in User has permission to view the file. I'd really appreciate your help as I'm kind of new to SharePoint and I searched a lot but found no clue about what I need.1.6KViews0likes1Comment
Recent Blog Articles
No content to show