Class RoleTemplate
Represents a template for a role in the permission system. When a module is bought these roles are automatically created.
Inherited Members
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class RoleTemplate : IRoleTemplate
Properties
AddForNewUser
BuiltIn
Gets or sets if this role is a system role.
Declaration
public bool BuiltIn { get; set; }
Property Value
Boolean
|
Implements
Remarks
A system role can't be deleted and must contain at least one user.
Claims
Navigation property for the claims this role template possesses.
Declaration
public virtual ICollection<RoleClaimTemplate> Claims { get; }
Property Value
System.Collections.Generic.ICollection<RoleClaimTemplate>
|
Implements
Id
Gets the identity of the role template.
Declaration
public Guid Id { get; set; }
Property Value
System.Guid
|
Implements
ModuleId
Gets or sets the identity of the module this role template belongs too.
Declaration
public Guid ModuleId { get; set; }
Property Value
System.Guid
|
Implements
Name
Gets or sets the name of the role.
Declaration
public string Name { get; set; }
Property Value
String
|
Implements
Methods
AddPermission(String)
Adds a permission claim with the supplied value.
Declaration
public bool AddPermission(string permission)
Parameters
String
permission
The value of the permission claim. |
Returns
Boolean
true if the permission was added; otherwise false. |
RemovePermission(String)
Removes the permission
from the template.
Declaration
public bool RemovePermission(string permission)
Parameters
String
permission
The permission to remove. |
Returns
Boolean
true if the permission was removed; otherwise false. |
ToString()
Returns the name of the role.
Declaration
public override string ToString()
Returns
String
The name of the role. |