Show / Hide Table of Contents

Class RoleTemplate

Represents a template for a role in the permission system. When a module is bought these roles are automatically created.

Inheritance
Object
RoleTemplate
Inherited Members
Object.Equals(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class RoleTemplate : IRoleTemplate

Properties

AddForNewUser

Declaration
public bool AddForNewUser { get; set; }
Property Value
Boolean

Implements
IRoleTemplate.AddForNewUser

BuiltIn

Gets or sets if this role is a system role.

Declaration
public bool BuiltIn { get; set; }
Property Value
Boolean

Implements
IRoleTemplate.BuiltIn
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
IRoleTemplate.Claims

Id

Gets the identity of the role template.

Declaration
public Guid Id { get; set; }
Property Value
System.Guid

Implements
IRoleTemplate.Id

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
IRoleTemplate.ModuleId

Name

Gets or sets the name of the role.

Declaration
public string Name { get; set; }
Property Value
String

Implements
IRoleTemplate.Name

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.

Overrides
System.Object.ToString()
Back to top Generated by DocFX