Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <string> allowedList = ConfigurationManager.AppSettings["UsermanagementAllowedList"].Split(';').Select(x => x.Trim().ToLower()).ToList <string>();

            ListDepartement = JsonConvert.SerializeObject(Helper.Helper.GetDepartment());
            ListEmployee    = JsonConvert.SerializeObject(new List <string>());
            ListRole        = JsonConvert.SerializeObject(MembershipHelper.GetAllRoles());
            ListUnitOrg     = JsonConvert.SerializeObject(new List <string>());
            if (!Roles.GetRolesForUser(User.Identity.Name)
                .Where(x => allowedList.Contains(x.ToLower())).ToList().Any() && !allowedList.Contains("*"))
            {
                Response.Redirect("AccessDenied.aspx");
            }

            if (!Page.IsPostBack)
            {
                BindRadComboBox();
                Helper.GirdHelper.SetUpGrid(RadGrid1);
            }
        }