Visual Guard Class Library Documentation

VGRoles.RemoveUsersFromRole Method (String[], String)

Removes the specified users from the specified role.

public static void RemoveUsersFromRole(
   String[] usernames,
   String roleName
);

Parameters

usernames
A string array of user names to remove from the specified roles.
roleName
The name of the role to remove the specified users from.

Exceptions

Exception Type Condition
ArgumentNullException roleName is null.

-or-

usernames is null or one of the user names in usernames is null.
ArgumentException roleName is an empty string or is longer than 64 characters or contains invalid chars ('\', '/', '?', '*', '%', ';', ''', '"', ':', '|', '[', ']', '+', '=', ',').

-or-

One of the user names in usernames is an empty string or is longer than 64 characters or contains invalid chars ('\', '/', '?', '*', '%', ';', ''', '"', ':', '|', '[', ']', '+', '=', ',')..

-or-

usernames contains a duplicate element.
SecurityException The current user has not enough privileges to use Membership API. The Membership access level of the application must be sufficient to allows this action or the 'Membership Manager' role must be granted to the user by using the Visual Guard console.

See Also

VGRoles Class | Novalys.VisualGuard.Security.Membership Namespace | VGRoles.RemoveUsersFromRole Overload List