Class: RoleService
Implements
RoleServiceInterface
Constructors
new RoleService()
new RoleService(
settings
,allRoleRepos
):RoleService
Parameters
Parameter | Type |
---|---|
settings | RoleSettingsInterface |
allRoleRepos | Record <string , Repository <RoleAssignmentEntityInterface >> |
Returns
Defined in
.tmp/repos/rockets/packages/nestjs-role/src/services/role.service.ts:22 (opens in a new tab)
Properties
Property | Modifier | Type |
---|---|---|
settings | readonly | RoleSettingsInterface |
Methods
getAssignedRoles()
getAssignedRoles(
assignment
,assignee
,queryOptions
?):Promise
<RoleEntityInterface
[]>
Get all roles for assignee.
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The assignment of the check (same as entity key) |
assignee | ReferenceIdInterface <string > | The assignee to check |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<RoleEntityInterface
[]>
Implementation of
RoleServiceInterface.getAssignedRoles
Defined in
.tmp/repos/rockets/packages/nestjs-role/src/services/role.service.ts:38 (opens in a new tab)
getAssignmentRepo()
protected
getAssignmentRepo(assignment
):Repository
<RoleAssignmentEntityInterface
>
Internal
Get the assignment repo for the given assignment.
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The role assignment |
Returns
Repository
<RoleAssignmentEntityInterface
>
Defined in
.tmp/repos/rockets/packages/nestjs-role/src/services/role.service.ts:148 (opens in a new tab)
isAssignedRole()
isAssignedRole<
T
>(assignment
,role
,assignee
,queryOptions
?):Promise
<boolean
>
Check if the assignee is a member of one role.
Type Parameters
Type Parameter |
---|
T extends ReferenceIdInterface <string , T > |
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The assignment of the check |
role | ReferenceIdInterface <string > | The role to check |
assignee | T | The assignee to check |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<boolean
>
Implementation of
RoleServiceInterface.isAssignedRole
Defined in
.tmp/repos/rockets/packages/nestjs-role/src/services/role.service.ts:75 (opens in a new tab)
isAssignedRoles()
isAssignedRoles<
T
>(assignment
,roles
,assignee
,queryOptions
?):Promise
<boolean
>
Check if the assignee is a member of every role.
Type Parameters
Type Parameter |
---|
T extends ReferenceIdInterface <string , T > |
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The assignment of the check |
roles | ReferenceIdInterface <string >[] | The roles to check |
assignee | T | The assignee to check |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<boolean
>
Implementation of
RoleServiceInterface.isAssignedRoles
Defined in
.tmp/repos/rockets/packages/nestjs-role/src/services/role.service.ts:113 (opens in a new tab)