Interface AuthorizationInterface
filterRightOn(
right: `${string}:${string}`,
objectIds: number[],
): Promise<number[]>;
getRootObjects(rights: `${string}:${string}`[]): Promise<number[] | "all">;
hasRight(right: `${string}:${string}`): Promise<boolean>;
hasRightOn(
right: `${string}:${string}`,
object: number | "any" | "all",
): Promise<boolean>;
}
Index
Methods
filter Right On
Parameters
- right: `${string}:${string}`
The targetted right to check, eg system:sysop (but not eg system:fs_fullaccess which requires hasRightOn)
- objectIds: number[]
Returns Promise<number[]>
- right: `${string}:${string}`
get Root Objects
List accessible root objects for a list of rights
Parameters
- rights: `${string}:${string}`[]
Rights to check. If the user has any of these rights (possibly implied) on an object, it will be returned
Returns Promise<number[] | "all">
The list of accessible object roots. "all" if the user has rights on all objects including any future objects
- rights: `${string}:${string}`[]
has Right
Check whether the user has a global right
Parameters
- right: `${string}:${string}`
The global right to check, eg system:sysop (but not eg system:fs_fullaccess which requires hasRightOn)
Returns Promise<boolean>
- right: `${string}:${string}`
has Right On
Check whether the user has a targetted right on a specific object (or inherited through its parnet)
Parameters
- right: `${string}:${string}`
The targetted right to check, eg system:sysop (but not eg system:fs_fullaccess which requires hasRightOn)
- object: number | "any" | "all"
The target object's id or "all"/"any" to verify access to all/any object(s)
Returns Promise<boolean>
- right: `${string}:${string}`
Filter objects on which the user has the requested right (a 'bulk' hasRightOn)