bpmn-server / CaseAccess
Class: CaseAccess#
Table of contents#
Constructors#
Properties#
Accessors#
Methods#
Constructors#
constructor#
• new CaseAccess(server): CaseAccess
Parameters#
| Name | Type |
|---|---|
server |
any |
Returns#
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:33
Properties#
_policy#
• Private _policy: SecurityPolicy
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:32
server#
• Readonly server: any
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:33
Accessors#
policy#
• get policy(): SecurityPolicy
The models folder's policies.
Returns#
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:35
on#
• get on(): boolean
Whether security policies decide here.
Returns#
boolean
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:42
Methods#
decide#
▸ decide(user, instance, task?): Promise\<IAccess>
What this user may do with the case, or with one of its tasks (task.elementId).
Parameters#
| Name | Type |
|---|---|
user |
SecureUser |
instance |
any |
task? |
Object |
task.elementId |
string |
task.itemId? |
string |
Returns#
Promise\<IAccess>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:45
seeQuery#
▸ seeQuery(user): Promise\<object>
The store's condition for the cases this user may see, from the policies (SecurityPolicy.seeQuery): a superset, so a list reads fewer cases before asking the policy for each; null when off, or any case may be seen.
Parameters#
| Name | Type |
|---|---|
user |
SecureUser |
Returns#
Promise\<object>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:57
seen#
▸ seen\<T>(user, instances): Promise\<T[]>
The cases this user sees (see not none), as they were given: decided several at once (decideAll).
Type parameters#
| Name |
|---|
T |
Parameters#
| Name | Type |
|---|---|
user |
SecureUser |
instances |
T[] |
Returns#
Promise\<T[]>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:67
decideAll#
▸ decideAll(user, entries): Promise\<IAccess[]>
Each case (and task) decided, DECIDE_AT_ONCE at a time, in their order: a list's page asks them together, so an application's decisionContext hook that waits (it asks another system) waits for several at once (docs/docs/performance.md#security-policies).
Parameters#
| Name | Type |
|---|---|
user |
SecureUser |
entries |
{ instance: any ; task?: { elementId: string ; itemId?: string } }[] |
Returns#
Promise\<IAccess[]>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:78
casesOf#
▸ casesOf(items): Promise\<Map\<string, any>>
The cases of these tasks, by id: what a policy decides on (their items, data and model).
Parameters#
| Name | Type |
|---|---|
items |
any[] |
Returns#
Promise\<Map\<string, any>>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:86
tasksAllowed#
▸ tasksAllowed\<T>(user, items): Promise\<T[]>
The waiting tasks this user may complete, as their cases' policies say (a task they are refused is left out).
Type parameters#
| Name | Type |
|---|---|
T |
extends Object |
Parameters#
| Name | Type |
|---|---|
user |
SecureUser |
items |
T[] |
Returns#
Promise\<T[]>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:94
data#
▸ data(instance, access, taskElementId?): Record\<string, any>
A case's data as this access lets them read it; for a task, its own form's fields too.
Parameters#
| Name | Type |
|---|---|
instance |
any |
access |
IAccess |
taskElementId? |
string |
Returns#
Record\<string, any>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:102
requireAssignment#
▸ requireAssignment(user, query, assignment?): Promise\<void>
Assigning the tasks a query finds (assignment: their assignee, candidates, dates): a person taking a task as
its assignee and nothing else is claiming it; any other change of who works on it is assign. Throws
PolicyDenied when a case's policy refuses it; without a rule, today's rule holds (the engine's: a part in it).
Parameters#
| Name | Type |
|---|---|
user |
SecureUser |
query |
any |
assignment |
Record\<string, any> |
Returns#
Promise\<void>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:111
instanceAccess#
▸ instanceAccess(instance, directory?): Promise\<{ on: boolean = true; cases: { who: IWho = a.who; see: "none" | "summary" | "full" = a.access.see; data: string ; restart: boolean = a.access.restart; events: boolean = a.access.events; rules: string }[] ; tasks: { seq: any = item.seq; elementId: any = item.elementId; name: any = item.name; status: any = item.status; said: { whom: string ; by: string ; notes: string[] } ; assignee: any ; candidateUsers: string[] ; candidateGroups: string[] ; decidedBy: string ; history: { action: any = l.action; why: string }[] ; completedBy: any ; who: any[] }[] }>
The instance page's Assignment and access, and API v3's GET /instances/{id}/access: for each of its user tasks,
after the fact, who it was offered to, its assignee, what decided it (a policy's rule, or who reassigned it),
its assignment as the log tells it (offered, claimed, reassigned) and who completed it; and, while security
policies are on, the reverse of the case's policy (SecurityPolicy.whoMay): who may see the case, its data, and
who may claim, complete and assign each waiting task. directory: the people and roles to ask about.
Parameters#
| Name | Type |
|---|---|
instance |
any |
directory |
Object |
directory.users? |
{ userName: string ; userGroups?: string[] }[] |
directory.roles? |
string[] |
directory.admins? |
string[] |
Returns#
Promise\<{ on: boolean = true; cases: { who: IWho = a.who; see: "none" | "summary" | "full" = a.access.see; data: string ; restart: boolean = a.access.restart; events: boolean = a.access.events; rules: string }[] ; tasks: { seq: any = item.seq; elementId: any = item.elementId; name: any = item.name; status: any = item.status; said: { whom: string ; by: string ; notes: string[] } ; assignee: any ; candidateUsers: string[] ; candidateGroups: string[] ; decidedBy: string ; history: { action: any = l.action; why: string }[] ; completedBy: any ; who: any[] }[] }>
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:129
require#
▸ require(access, action, byDefault?): void
Throws PolicyDenied unless the action is allowed; byDefault: what it is without a rule (claim, complete, assign).
Parameters#
| Name | Type | Default value |
|---|---|---|
access |
IAccess |
undefined |
action |
"restart" | "assign" | "claim" | "complete" | "events" |
undefined |
byDefault |
boolean |
false |
Returns#
void
Defined in#
packages/bpmn-server/src/addons/security/CaseAccess.ts:176