Permissions - midspace/Space-Engineers-Admin-script-mod GitHub Wiki

Players and commands have certain levels. A level is a positive number from 0 to 4,294,967,295. A player can not use a command that has a higher level than his own level. The default administrator level can be set in the config and is set to 100 by default. Normal users have a default level of 0. The default level for admin commands is also set to 100 but the default value can not be changed. The user commands have the level 0.

Moreover custom groups can be created that have a level and members. All members will have the level of the group. If a player is member of several groups he will get the level of the group with the highest level. Furthermore the player himself has a level that must be activated by setting "useplayerlevel" to true, otherwise the group level or, if the player is not member of any group, the default level will be used.

Through the setlevel, individual commands can also be disabled and removed from access from either your general players, or all players including admins.
Additionally you can extend the rights of a specific player for a specific command, i.e. the player will always have access to the command regardless of any levels. The contrary, restrictions of certain commands, is also available.


This command is used for organizing the permissions ingame.
Syntax: /perm <domain> <action> [<subject> [<parameter>]]
Domains: command, player, group
Each domain has specific actions.

Actions:

For 'command'

  • setlevel
    Sets the needed level for a command to the specified level.
    Example: /perm command setlevel help 100

To remove access to all players use the word `none`.
Example: `/perm command setlevel motd none`

- list
Creates a hotlist containing all commands and provides information about the needed level of the commands. Use a keyword to refine your search
Example: `/perm command list roid`

For 'player'

  • setlevel
    Sets the level of a player to the specified value. Remind that you have to set useplayerlevel to true otherwise using this won't make any difference.
    Example: /perm player setlevel MyPlayerName 150
    Example: /perm player setlevel "My Long Player Name" 150

- extend
Grants the specified player to use the specified command regardless of his level. When a player has extended rights use 'restrict' to restore normal permissions. When a player has restricted rights you can use this command to restore normal permissions.
Example: `/perm player extend MyPlayerName tp`
-> If the player had normal access to the command, he will be able to use it from now regardless of his level. If the player had restricted access to the command he will have normal access from now.

- restrict
Prevents the specified player from using the specified command regardless of his level. When a player has restricted rights use 'extend' to restore normal permissions. When a player has extended rights you can use this command to restore normal permissions.
Example: `/perm player restrict MyPlayerName tp`
-> If the player had normal access to the command, he won't be able to use it any longer regardless of his level. If the player had extended access to the command he will have normal access from now.

- useplayerlevel
If set to true the level of the player will be used. By default it is false.
Example: `/perm player useplayerlevel MyPlayerName true`

- list
Creates a hotlist containing all players and provides information about them. Use a keyword to refine your search Example: `/perm player list`

For 'group'

  • setlevel
    Sets the level of a group to the specified value.
    Example: /perm group setlevel mygroup 150

- setname
Sets the name of a group to the specified value.
Example: `/perm group setname mygroup mynewgroupname`

- add
Adds the specified player to the specified group.
Example: `/perm group add mygroup MyPlayerName`

- remove
Removes the specified player from the specified group.
Example: `/perm group remove mygroup MyPlayerName`

- create
Creates a new group with a specified name and a specified level
Example: `/perm group create mygroup 150`

- delete
Deletes the specified group.
Example: `/perm group delete mygroup`

- list
Creates a hotlist containing all groups and provides information about them. Use a keyword to refine your search
Example: `/perm group list`

Examples:

To permanently elevate a particular player to full Admin

You will need to use the following commands, to first find the player you wish to elevate (they may have complex name or spaces in their name), and then set their permission level, following by instructing the system to use that number otherwise they will only inherit permissions from their group or default level.
/perm player list
The player you may choose in this example is #3.
/perm player setlevel #3 100
/perm player useplayerlevel #3 true

To remove commands from access by regular players

Utilize the /perm command setlevel command, to raise the required access for a command to 100 so that only Admins can use them.
/perm command setlevel chat 100
/perm command setlevel date 100
/perm command setlevel head 100
/perm command setlevel hello 100
/perm command setlevel motd 100
/perm command setlevel pos 100
/perm command setlevel status 100
/perm command setlevel settings 100
/perm command setlevel time 100
/perm command setlevel version 100

To remove them from Admin access also, use the word none instead of the level.
Example: /perm command setlevel motd none

⚠️ **GitHub.com Fallback** ⚠️