Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var userId = Context.User.Identity.GetUserId();
            var user   = _userCache.Get(userId);

            if (!Permissions.CanManageUsers(user?.RoleId))
            {
                Response.Redirect("~/Default.aspx");
            }

            if (!Page.IsPostBack)
            {
                RefreshGrid();
            }
        }
 private void SetPermissions(CachedUser user)
 {
     ManageDepartments.Visible = Permissions.CanManageDepartments(user?.RoleId);
     ManageServers.Visible     = Permissions.CanManageServers(user?.RoleId);
     ManageUsers.Visible       = Permissions.CanManageUsers(user?.RoleId);
 }