Friday, June 8, 2012

How to get user permissions in sharepoint 2010

he user has automatically get some roles and permission when he registered into any enterprise level website.In this article i will explain how to retrieve the current user permission in share point 2010.In share point we have GetByName method which is used to get the roles based on user and get the permissions using roles
ClientContext clc = new ClientContext(url);
RoleDefinition Rdef = clc.Web.RoleDefinitions.GetByName("Test");
clc.Load(Rdef);
clc.ExecuteQuery();
BasePermission Bper = Rdef.BasePermissions;
Console.Writeline(Bper);
Post a Comment

Bel