public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _userName = AuthRequest.GetQueryString("UserName"); if (IsPostBack) { return; } var roles = DataProvider.AdministratorsInRolesDao.GetRolesForUser(_userName); if (AuthRequest.AdminPermissions.IsConsoleAdministrator) { DdlPredefinedRole.Items.Add(EPredefinedRoleUtils.GetListItem(EPredefinedRole.ConsoleAdministrator, false)); DdlPredefinedRole.Items.Add(EPredefinedRoleUtils.GetListItem(EPredefinedRole.SystemAdministrator, false)); } DdlPredefinedRole.Items.Add(EPredefinedRoleUtils.GetListItem(EPredefinedRole.Administrator, false)); var type = EPredefinedRoleUtils.GetEnumTypeByRoles(roles); ControlUtils.SelectSingleItem(DdlPredefinedRole, EPredefinedRoleUtils.GetValue(type)); SiteManager.AddListItems(CblSiteId); ControlUtils.SelectMultiItems(CblSiteId, DataProvider.AdministratorDao.GetSiteIdList(_userName)); ListBoxDataBind(); DdlPredefinedRole_SelectedIndexChanged(null, EventArgs.Empty); }