Adds a new role to the repository.
Namespace: Novalys.VisualGuard.Security.MembershipAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2017.0.101.17 (2017.0.101.17)
Syntax
C# |
---|
[ObsoleteAttribute("This class is obsolete now, plz use VGSecurityManager.Runtime.Roles", true)] public VGRole CreateSharedRole( string roleName, string description, Guid permissionSetId, Guid applicationId ) |
Visual Basic |
---|
<ObsoleteAttribute("This class is obsolete now, plz use VGSecurityManager.Runtime.Roles", true)> Public Function CreateSharedRole ( roleName As String, description As String, permissionSetId As Guid, applicationId As Guid ) As VGRole |
Parameters
- roleName
- Type: System..::..String
The name of the role to create.
- description
- Type: System..::..String
a short description of the role
- permissionSetId
- Type: System..::..Guid
The repository id of the permission set assigned to the role. Empty when there is no permission set assigned to the role.
- applicationId
- Type: System..::..Guid
The Id of the application where you want to create the specified roles.
Return Value
Type: VGRolethe role added to the repository.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | roleName is null (Nothing in VB.Net).
-or- applicationIdis null. |
System..::..ArgumentException | roleName is empty or contains invalid chars ('\', '/', '?', '*', '%', ';', ''', '"', ':', '|', '[', ']', '+', '=', ',').
or roleName is longer than 64 characters. or a role with the same name already exists in the repository.or permissionSetId does not exist in the repository fro the application.or applicationId does not exist in the repository. |
System.Security..::..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. |