Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How to disable Is Global Administrator? View modes: 
User avatar
Member
Member
ahmed.hassan-dream-makers - 1/26/2011 6:36:15 AM
   
How to disable Is Global Administrator?
Hi,

I have a question about the Global Administrator, I need to hide or disable the checkbox of the Is Global Administrator to any user who is not Global Administrator, so Only Global Admins can assign another Global Admins but no other user role can do so, how is that possible?

User avatar
Member
Member
kentico_michal - 1/26/2011 7:13:07 AM
   
RE:How to disable Is Global Administrator?
Hi,

I am not sure if I understand your request correctly, because IsGlobalAdministrator checkbox is disabled for users who are not global administrators by default. You can take a look into ~\CMSSiteManager\Administration\Users\User_Edit_General.aspx.cs file, where you can see following code in Page_Load method:

CheckBoxLabelIsGlobalAdministrator.Enabled = CMSContext.CurrentUser.IsGlobalAdministrator;

As a result, only global administrators are able to use enabled IsGlobalAdministrator checkbox.

So could you please describe in more detail what are you trying to achieve?
Moreover, which version of Kentico CMS are you using?

Best regards,
Michal Legen

User avatar
Member
Member
ahmed.hassan-dream-makers - 1/26/2011 7:19:33 AM
   
RE:How to disable Is Global Administrator?
Hi Michal,

Thanks for your reply, I am working on version v5.5.3789. What I need to achieve is that I can give access to admins for cmsdesk only which include "Users" management that I do not want them to access the Site Manager. hopefully it is clear now.

User avatar
Member
Member
kentico_michal - 1/28/2011 3:51:31 AM
   
RE:How to disable Is Global Administrator?
Hi Ahmed,

You could consider hiding isGlobaAdministrator checkbox for all users who are not global administrators.
In order to achieve this you will need to add following code snippet into Page_Load method in ~\CMSSiteManager\Administration\Users\User_Edit_General.aspx.cs:


CheckBoxLabelIsGlobalAdministrator.Enabled = CMSContext.CurrentUser.IsGlobalAdministrator;

// START
if (!CMSContext.CurrentUser.IsGlobalAdministrator)
{
plcGlobalAdmin.Visible = false;
}
// END

userId = QueryHelper.GetInteger("userid", 0);


Best regards,
Michal legen