Grants the permission to use the Membership API to edit, create, delete or assign role to users for the current application
Namespace: Novalys.VisualGuard.Security.MembershipAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2017.0.101.17 (2017.0.101.17)
Syntax
C# |
---|
public static bool GrantMembershipPermission( string username ) |
Visual Basic |
---|
Public Shared Function GrantMembershipPermission ( username As String ) As Boolean |
Parameters
- username
- Type: System..::..String
The user to grant membership permission for.
Return Value
Type: Booleantrue if the membership permission was successfully granted; otherwise, false. A value of false is also returned if the user does not exist in the repository.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentException | username is an empty string, is longer than 64 characters, or contains invalid characters ('\', '/', '?', '*', '%', ';', ''', '"', ':', '|', '[', ']', '+', '=', ','). |
System..::..ArgumentNullException | username is null. |
System.Security..::..SecurityException | The current user has not enough privileges to use Membership API. The 'Membership Manager' role must be granted to the user by using the Visual Guard console. |