static public void RemoveUsersFromRole(string[] usernames, string roleName) { EnsureEnabled(); SecUtility.CheckParameter(ref roleName, true, true, true, 0, "roleName"); SecUtility.CheckArrayParameter(ref usernames, true, true, true, 0, "usernames"); Provider.RemoveUsersFromRoles(usernames, new string[] { roleName }); try { RolePrincipal user = GetCurrentUser() as RolePrincipal; if (user != null && user.ProviderName == Provider.Name && user.IsRoleListCached) { foreach (string username in usernames) { if (StringUtil.EqualsIgnoreCase(user.Identity.Name, username)) { user.SetDirty(); break; } } } } catch { } }
public static void RemoveUsersFromRoles(string[] usernames, string[] roleNames) { EnsureEnabled(); SecUtility.CheckArrayParameter(ref roleNames, true, true, true, 0, "roleNames"); SecUtility.CheckArrayParameter(ref usernames, true, true, true, 0, "usernames"); Provider.RemoveUsersFromRoles(usernames, roleNames); try { RolePrincipal currentUser = GetCurrentUser() as RolePrincipal; if (((currentUser != null) && (currentUser.ProviderName == Provider.Name)) && currentUser.IsRoleListCached) { foreach (string str in usernames) { if (System.Web.Util.StringUtil.EqualsIgnoreCase(currentUser.Identity.Name, str)) { currentUser.SetDirty(); return; } } } } catch { } }
public static void RemoveUserFromRole(string username, string roleName) { EnsureEnabled(); SecUtility.CheckParameter(ref roleName, true, true, true, 0, "roleName"); SecUtility.CheckParameter(ref username, true, true, true, 0, "username"); Provider.RemoveUsersFromRoles(new string[] { username }, new string[] { roleName }); try { RolePrincipal currentUser = GetCurrentUser() as RolePrincipal; if (((currentUser != null) && (currentUser.ProviderName == Provider.Name)) && (currentUser.IsRoleListCached && System.Web.Util.StringUtil.EqualsIgnoreCase(currentUser.Identity.Name, username))) { currentUser.SetDirty(); } } catch { } }
public static void RemoveUsersFromRoles(string [] usernames, string [] roleNames) { Provider.RemoveUsersFromRoles(usernames, roleNames); }
public static void RemoveUsersFromRole(string [] usernames, string roleName) { Provider.RemoveUsersFromRoles(usernames, new string[] { roleName }); }
public static void RemoveUserFromRoles(string username, string [] roleNames) { Provider.RemoveUsersFromRoles(new string[] { username }, roleNames); }
public static void RemoveUserFromRole(string username, string rolename) { Provider.RemoveUsersFromRoles(new string[] { username }, new string[] { rolename }); }