protected void Page_Init(object sender, EventArgs e)
        {
            if (allRoles.Count() == 0)
            {
                allRoles = RolesMapper.RemoveRoles(RolesMapper.GetAll(), rolesToRemove);
            }

            Bind();
        }
Esempio n. 2
0
        private void BindRolesList()
        {
            var roles = RolesMapper.GetAll().ToList();

            if (!CurrentUser.IsInRole(RoleEnum.Developer))
            {
                roles = roles.Where(i => i != RolesMapper.GetByEnum(RoleEnum.Developer)).ToList();
            }

            RolesList.DataSource     = roles;
            RolesList.DataTextField  = "Name";
            RolesList.DataValueField = "ID";
            RolesList.DataBind();
        }