Visual Guard Class Library Documentation

VGRoles.RemoveUserFromRole Method (String, String)

Removes the specified user from the specified role.

public static void RemoveUserFromRole(
   String username,
   String roleName
);

Parameters

username
The user to remove from the specified role.
roleName
The role to remove the specified user from.

Exceptions

Exception Type Condition
ArgumentNullException roleName is null.

-or-

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

-or-

roleName was not found in the repository for the application.

-or-

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

-or-

username was not found in the repository.
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.RemoveUserFromRole Overload List