public bool HasPermission(eSys_Module eSys_Module, eSys_User admin, Sys_Module_Actions action) { try { if (eSys_Module == null || admin == null) { return(false); } if (eSys_Module.ID == 0) //System { return(admin.CanAccessSystemMenu); } //Nếu là God, luôn TRUE if (admin.ID == eSys_User.GodUser.ID) { return(true); } string actionid = "@" + (int)action + ";"; //Bản thân eSys_Module ko có action này if (eSys_Module.Actions.IndexOf(actionid) < 0) { return(false); } eSys_RolePermission permission = admin.RolePermissions.FirstOrDefault(o => o.ModuleID == eSys_Module.ID); if (permission == null) { return(false); } if (permission.Permissions.IndexOf(actionid) < 0) { return(false); } return(true); } catch { return(false); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { eSys_User currentAdmin = CurrentSys_User; if (currentAdmin != null) { if (string.IsNullOrEmpty(currentAdmin.Avatar)) { imgAvatar.Src = ResolveUrl(SiteValues.LogoPath); } else { imgAvatar.Src = ResolveUrl(currentAdmin.Avatar); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { eSys_User currentAdmin = CurrentSys_User; if (currentAdmin != null) { if (string.IsNullOrEmpty(currentAdmin.Avatar)) { imgAvatar.Src = ResolveUrl(SiteValues.LogoPath); } else { imgAvatar.Src = ResolveUrl(currentAdmin.Avatar); } divFullname.InnerHtml = currentAdmin.Firstname + ", " + currentAdmin.Lastname; } LoadMenus(); } }
public bool HasPermission(eSys_Module eSys_Module, eSys_User admin, Sys_Module_Actions action) { return(((BasePage)this.Page).HasPermission(eSys_Module, admin, action)); }