public virtual AccessMode GetAccessMode(string roleName) { roleName = roleName.ToLower(); if (AccessRole.Any(x => x.Key == roleName)) { return(AccessRole[roleName]); } return(AccessMode.Edit); }
public virtual void AddAccess(string roleName, AccessMode mode) { roleName = roleName.ToLower(); if (AccessRole.Any(x => x.Key == roleName)) { AccessRole.Remove(roleName); } AccessRole.Add(roleName, mode); }