Visual Guard Class Library Documentation

VGRolesInstance.RemoveUserFromRoles Method (String, String[])

Removes the specified user from the specified roles.

public void RemoveUserFromRoles(
   String username,
   String[] roleNames
);

Parameters

username
The user to remove from the specified roles.
roleNames
A string array of role names to remove the specified user from.

Exceptions

Exception Type Condition
ArgumentNullException roleNames is null or one of the roles in roleNames is null.

-or-

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

-or-

username is an empty string or is longer than 64 characters or contains invalid chars ('\', '/', '?', '*', '%', ';', ''', '"', ':', '|', '[', ']', '+', '=', ',').

-or-

roleNames 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

VGRolesInstance Class | Novalys.VisualGuard.Security.Membership Namespace | VGRolesInstance.RemoveUserFromRoles Overload List