Class Permissions

Contains permissions used by Server to keep track of what player Clients can do.

Permissions

  • Read: The player can read the value
  • Write: The player can write to the value

Functions

Permissions.new() Construct a new Permissions object wherein no player has any permissions

Methods

Permissions:exclusive() Constructs a new Permissions wherein no player has any permission
Permissions:inclusive() Constructs a new Permissions wherein every player has all permissions
Permissions:readOnly() Constructs a new Permissions wherein all players can read the value, and none can write
Permissions:cleanup() Release all resources used
Permissions:getPermissionPlayerSet(permission) Retrieves the PlayerSet used for the given permission
Permissions:hasPermission(player, permission) Queries whether a player has a permission
Permissions:assertPermission(player, permission) Asserts that the given player has the given permission
Permissions:hasRead(player) Returns whether the given player has Read permission
Permissions:assertRead(player) Asserts that the given player has Read permissions
Permissions:hasWrite(player) Returns whether the given player has Write permission
Permissions:assertWrite(player) Asserts that the given player has Write permissions
Permissions:collect(player) For a given player, checks if they have each permission


Functions

Methods
Permissions.new()
Construct a new Permissions object wherein no player has any permissions

Methods

Permissions:exclusive()
Constructs a new Permissions wherein no player has any permission
Permissions:inclusive()
Constructs a new Permissions wherein every player has all permissions
Permissions:readOnly()
Constructs a new Permissions wherein all players can read the value, and none can write
Permissions:cleanup()
Release all resources used
Permissions:getPermissionPlayerSet(permission)
Retrieves the PlayerSet used for the given permission

Parameters:

  • permission

Returns:

    PlayerSet The set for the given permission
Permissions:hasPermission(player, permission)
Queries whether a player has a permission

Parameters:

  • player The player to query
  • permission The permission to query

Returns:

    boolean
Permissions:assertPermission(player, permission)
Asserts that the given player has the given permission

Parameters:

  • player
  • permission
Permissions:hasRead(player)
Returns whether the given player has Read permission

Parameters:

  • player The player to query

Returns:

    boolean
Permissions:assertRead(player)
Asserts that the given player has Read permissions

Parameters:

  • player The player to query
Permissions:hasWrite(player)
Returns whether the given player has Write permission

Parameters:

  • player The player to query

Returns:

    boolean
Permissions:assertWrite(player)
Asserts that the given player has Write permissions

Parameters:

  • player The player to query
Permissions:collect(player)
For a given player, checks if they have each permission

Parameters:

  • player The player whose permissions are queried

Returns:

    table A dictionary where [permission] = true/false
generated by LDoc 1.4.6 Last updated 2021-01-21 07:22:00