Class Role
Define a list of permissions that can be used
Inherited Members
Namespace: Innovt.Domain.Security
Assembly: Innovt.Domain.dll
Syntax
public class Role : Entity<Guid>
Constructors
| Edit this page View SourceRole()
Initializes a new instance of the Role class.
Declaration
public Role()
Properties
| Edit this page View SourceDescription
Gets or sets the description of the role.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
Name
Gets or sets the name of the role.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Permissions
Gets or sets the list of permissions associated with the role.
Declaration
public IList<Permission> Permissions { get; set; }
Property Value
Type | Description |
---|---|
IList<Permission> |
Scope
Gets or sets the scope of the role.
Declaration
public string Scope { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceAssignPermission(Permission)
Assigns a permission to the role.
Declaration
public void AssignPermission(Permission permission)
Parameters
Type | Name | Description |
---|---|---|
Permission | permission | The permission to be assigned. |
Equals(object)
Determines whether the current Role instance is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
| Edit this page View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
| Edit this page View SourceRemovePermission(Guid)
Removes a permission from the role by its identifier.
Declaration
public void RemovePermission(Guid permissionId)
Parameters
Type | Name | Description |
---|---|---|
Guid | permissionId | The identifier of the permission to be removed. |