0

I need to check If Specific User has Permissions to Web.
I cannot find any way to do it in SharePoint 2010 Client Object Model.
I need an alternative of SPWeb.DoesUserHavePermissions(string userLoginName, SPBasePermissions permissions) which is also accepted login name since client object model has this method only to check current user permissions. Beginning with SharePoint 2013 there is a method Web.GetUserEffectivePermissions(userLoginName) but this is not the case since it doesn't work in SharePoint 2010.

0

In the client object model you can check this property GetUserEffectivePermissions

string userName="UserLoginName"
ClientResult<BasePermissions> info = site.Web.GetUserEffectivePermissions(userName);

     //info.RoleAssignments is not recognized
     foreach (SPRoleAssignment roleAssignment in info.RoleAssignments)
     {
          //do further coding as per your need
     }
| improve this answer | |
  • Thank you very much for your answer but as I wrote this method is accessible only in SharePoint 2013. In SharePoint 2010 I receive an exception using this method. – Evgenia Kotova Apr 2 at 10:36
  • Hi - I think GetUserEffectivePermissions and DoesUserHavePermissions are different. You can try with the GetUserEffectivePermissions – Habibur Rahaman Apr 2 at 12:17
  • This method is not available in SharePoint 2010. – Evgenia Kotova Apr 2 at 13:38

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.