Retrieve SharePoint 2010 Permission Levels to a ASP.NET DropDownList

Below code shows how we can get the SharePoint permission levels and assign it to a ASP.NET DropDownList (drpPermissions)

drpPermissions.AppendDataBoundItems = true;

SPWeb currentSite = SPContext.Current.Site.RootWeb;


SPRoleDefinitionCollection permissionColl = currentSite.RoleDefinitions;

foreach (SPRoleDefinition permission in permissionColl)
{

drpPermissions.Items.Add(permission.Name.ToString());
drpPermissions.DataBind();
}

No comments:

Post a Comment

tablename_WriteToDataDestination: Mashup Exception Data Source Error Couldn't refresh the entity...

 Once a Dataflow is created and published on Fabric, got the below error while refreshing the Dataflow. tablename_ WriteToDataDestination: M...