Exemple #1
0
 public static void UpdateRole(RoleInfo role)
 {
     if (((role != null) && !IsBuiltInRole(role.Name)) && ((role.Name != null) && (role.Name.Length != 0)))
     {
         MemberRoleProvider.Instance().UpdateRole(role);
     }
 }
Exemple #2
0
 public static void AddPrivilegeInRoles(Guid roleId, string privilege)
 {
     if (string.IsNullOrEmpty(privilege))
     {
         MemberRoleProvider.Instance().DeletePrivilegeInRoles(roleId);
     }
     else
     {
         MemberRoleProvider.Instance().AddDeletePrivilegeInRoles(roleId, privilege);
     }
 }
Exemple #3
0
        public static IList <int> GetUserPrivileges(string username)
        {
            string      key = string.Format("DataCache-ManagerPrivileges:{0}", username);
            IList <int> privilegesForUser = HiCache.Get(key) as List <int>;

            if (privilegesForUser == null)
            {
                try
                {
                    privilegesForUser = MemberRoleProvider.Instance().GetPrivilegesForUser(username);
                    HiCache.Insert(key, privilegesForUser, 360);
                }
                catch
                {
                    FormsAuthentication.SignOut();
                    HttpContext.Current.Response.Redirect(Globals.GetSiteUrls().Home);
                }
            }
            return(privilegesForUser);
        }
Exemple #4
0
 public static ArrayList GetRoles(int userID)
 {
     return(MemberRoleProvider.Instance().GetRoles(userID));
 }
Exemple #5
0
 public static ArrayList GetRoles()
 {
     return(MemberRoleProvider.Instance().GetRoles());
 }
Exemple #6
0
 public static RoleInfo GetRole(string roleName)
 {
     return(MemberRoleProvider.Instance().GetRole(Guid.Empty, roleName));
 }
Exemple #7
0
 public static RoleInfo GetRole(Guid roleID)
 {
     return(MemberRoleProvider.Instance().GetRole(roleID, null));
 }
Exemple #8
0
 public static IList <int> GetPrivilegeByRoles(Guid roleId)
 {
     return(MemberRoleProvider.Instance().GetPrivilegeByRoles(roleId));
 }
Exemple #9
0
 public static bool PrivilegeInRoles(Guid roleId, int privilege)
 {
     return(MemberRoleProvider.Instance().PrivilegeInRoles(roleId, privilege));
 }