Example #1
0
 public virtual AccessMode GetAccessMode(string roleName)
 {
     roleName = roleName.ToLower();
     if (AccessRole.Any(x => x.Key == roleName))
     {
         return(AccessRole[roleName]);
     }
     return(AccessMode.Edit);
 }
Example #2
0
        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);
        }