Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How to read document type security permission setting by using any webparts or by using any SQL Query or any other way? View modes: 
User avatar
Member
Member
gaurav.agrawal-octalsoftware - 1/16/2012 4:41:52 AM
   
How to read document type security permission setting by using any webparts or by using any SQL Query or any other way?
how to read document type security permission setting by using any webparts or by using any SQL Query or any other way??

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 1/17/2012 2:43:07 AM
   
RE:How to read document type security permission setting by using any webparts or by using any SQL Query or any other way?
Hi,

here is an API example which you can use to check document type permissions:

private bool CheckDocTypePermissions()
{
// Get the user
UserInfo user = UserInfoProvider.GetUserInfo("CMSEditor");

if (user != null)
{
// Check permissions and perform an action according to the result
if (UserInfoProvider.IsAuthorizedPerClass("CMS.MenuItem", "Read", CMSContext.CurrentSiteName, user))
{
apiCheckDocTypePermissions.InfoMessage = "User 'CMSEditor' is allowed to read document type 'MenuItem'.";
}
else
{
apiCheckDocTypePermissions.InfoMessage = "User 'CMSEditor' is not allowed to read document type 'MenuItem'.";
}
return true;
}
return false;
}


More API examples you can find here:
http://domain.com/CMSAPIExamples/Default.aspx

Best regards,
Ivana Tomanickova