0

I have an application that needs to be able to use my SharePoint API to check if a user AD\USERNAME has access to see a list item. I have the server relative URL of the list item, and the object identity.

I do NOT want to use the list item role assignments because this only has AD groups without their nested permissions. So I'd have to then access active directory which is a big pain.

I want similar to what this does:

The check permissions feature is what I want This is the feature I want

0

Get item level permission as described here might help

  • Hi welcome to sharepoint stack exchange. My question states clearly that is not an option for me. I even explained why. – Nicholas DiPiazza Nov 9 at 14:37
0

After some more googling, found the answer embedded in another question GetUserEffectivePermissions returns wrong results which is answered correctly.

using (var ctx = new ClientContext("http://comtoso.com"))
{
     var list = ctx.Web.Lists.GetByTitle("TestList");
                ctx.Load(list);
                ctx.ExecuteQuery();

     var permissions = list.GetUserEffectivePermissions(@"i:0#.w|domain\username");
     ctx.ExecuteQuery();

     foreach (var permission in Enum.GetValues(typeof(PermissionKind)).Cast<PermissionKind>())
     {
          var permissionName = Enum.GetName(typeof(PermissionKind), permission);
          var hasPermission = permissions.Value.Has(permission);
          Debug.WriteLine("Permission: {0}, HasPermission: {1}", permissionName, hasPermission);
     }
}

I also cross posted this question https://social.technet.microsoft.com/Forums/Sharepoint/en-US/98c6d208-b27a-4c8a-9789-067f0b16f690/what-is-the-api-given-a-user-id-to-tell-me-permissions-for-a-user-of-a-list-item-id?forum=sharepointdevelopment and there are some other alternatives supplied there as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.