if (oWeb.DoesUserHavePermissions(SPBasePermissions.ViewPages))
{
SPList oList = oWeb.Lists[ListName];
if (oList.DoesUserHavePermissions(SPBasePermissions.ViewListItems))
{
// some smart code
}
}
------------------------------------
Code Block # 1
using (SPSite oSite = new SPSite(http://xxx))
{
using (SPWeb oWeb = oSite.RootWeb)
{
if(oWeb.DoesUserHavePermissions( oWeb.RoleDefinitions["Contribute"].BasePermissions))
//Do Something
else
//Do Something
}
}----------------------
Code Block # 2
No comments:
Post a Comment