API reference / @jsprismarine/prismarine / permission/PermissionManager
permission/PermissionManager
Classes
Interfaces
PermissionChange
Defined in: packages/prismarine/src/permission/PermissionManager.ts:112
What a write touched, for whoever listens: the user by subject and the name their record shows, or the group. A reload touches everything and names nothing.
Properties
group?
readonlyoptionalgroup?:string
Defined in: packages/prismarine/src/permission/PermissionManager.ts:115
name?
readonlyoptionalname?:string
Defined in: packages/prismarine/src/permission/PermissionManager.ts:114
subject?
readonlyoptionalsubject?:Subject
Defined in: packages/prismarine/src/permission/PermissionManager.ts:113
PermissionManagerOptions
Defined in: packages/prismarine/src/permission/PermissionManager.ts:82
What a test may replace in the manager: the clock expiry reads, and whether the file is watched.
Properties
now?
readonlyoptionalnow?: () =>number
Defined in: packages/prismarine/src/permission/PermissionManager.ts:84
Now, in milliseconds since the epoch. Defaults to Date.now.
Returns
number
watch?
readonlyoptionalwatch?:boolean
Defined in: packages/prismarine/src/permission/PermissionManager.ts:86
Whether a change to permissions.json on disk reloads it. Defaults to true.
Type Aliases
NamedSubject
NamedSubject =
Pick<PlayerIdentity,"subject"|"name">
Defined in: packages/prismarine/src/permission/PermissionManager.ts:106
Whose record to write: the subject, and the name the record shows.
PermissionHolder
PermissionHolder =
Pick<PlayerIdentity,"subject">
Defined in: packages/prismarine/src/permission/PermissionManager.ts:103
Whose permissions to read: the identity a login carries, by its subject.
PermissionManagerServer
PermissionManagerServer =
Pick<Server,"getLogger"|"getSessionManager"|"getKernel">
Defined in: packages/prismarine/src/permission/PermissionManager.ts:79
The parts of the server the permission manager uses. A test can hand in these alone.
PermissionSubject
PermissionSubject =
Console| {hasPermission(node):boolean; }
Defined in: packages/prismarine/src/permission/PermissionManager.ts:100
Anything that can be checked for command permissions: the console, or a player-like object that says whether it holds a node after resolution, operator status included.
Functions
canExecute()
canExecute(
executer?):object
Defined in: packages/prismarine/src/permission/PermissionManager.ts:133
Build a permission check for an executer. The console always passes; otherwise the executer decides the node after resolution, which grants an operator everything the operator group holds unless a node of their own or a heavier group takes it away.
Parameters
executer?
The console or player to check.
Returns
object
An object whose execute method takes a permission string and reports whether the executer may run it. not().execute negates the result. A missing permission string always passes.
execute
execute: (
permission?) =>boolean
Parameters
permission?
string
Returns
boolean
not
not: () =>
object
Returns
object
execute
execute: (
permission?) =>boolean
Parameters
permission?
string
Returns
boolean
Throws
Error when execute is called and the executer is undefined.