Skip to main content

Roles and Permissions

Verza's platform includes a roles and permissions system that can be integrated with the commands and actions to control access. Roles are used to group players based on their permissions, and permissions are used to control what actions players can perform. This allows for fine-grained control over who can use which commands and access certain features of the platform, as well as custom logics via player.hasAccess or player.hasRole.

Managing Roles

To manage roles, go to the Roles tab from the Server Settings. From there, you can create new roles, edit existing ones, and assign roles to players.

You can also assign roles to players via scripts using the player.addRole and player.removeRole methods from a server script.

Roles creation

Please note that roles can only be created from the Server Settings UI and cannot be created via scripts at the moment.

img

Managing Permissions

In Verza, permissions for commands and actions are defined by the name of the command or action itself. For example, if you create a command called admin, the permission required to access that command will also be called admin.

To manage permissions, go to the Commands & Actions tab from from the Server Settings.

Once you're in the Server Settings UI, click on the Commands & Actions tab to see a list of all the available commands. For each command, you can assign a specific role that is required to access it. This means that only players with that role will be able to use the command.

To assign a role to a command, simply click on the role dropdown next to the command and select the desired role from the list. You can assign multiple roles to a command if you want to allow multiple groups of players to access it.

img

You can also assign roles to players from the Members tab:

img

Commands vs Actions

Commands and Actions are both ways to define player interactions in Verza. Commands are messages prefixed with a slash (/) in the chat that trigger predefined functionality, while Actions are used to grant or restrict access to certain functionality programmatically.

For example:

Command: /kick player1 - Kicks player1 from the server.

Actions: player.hasAccess('+miner') - Checks if the player has access to the +miner action.

Think of Commands as something that players can trigger directly, while Actions are used to control access to functionality based on a player's assigned roles.

You can check if a player has access to a specific command or action using the player.hasAccess method.

Commands

Commands are created using the Command class, and can be registered with the commands.register method. Commands are identified by a unique name, and can be executed by players by typing the name preceded by a slash (/) in the chat like so: /fireworks.

Actions

Actions are not triggered by players directly, but are used to grant or restrict access to functionality based on a player's assigned roles. Actions are essentially just permissions that can be checked using the player.hasAccess method. For example, if a player has been assigned the admin role, which grants access to the +kick action, they can use the player.hasAccess('+kick') method to check if they have permission to kick another player.

Conclusion

In conclusion, commands are used to trigger predefined functionality, while actions are used to control access to functionality based on a player's assigned roles.

Special Admin Role

The Admin role is a special role that is automatically created when you create a new server. This role is assigned to the server owner by default and has the name Owner, it grants access to specific server-side-only actions from the client.

You can identify the Admin special role by its tag along with the Admin name like in the following screenshot.

Admin Role

By default the name of the role is Owner, you can change it to whatever you want, however the role will always be Admin.

As mentioned above, the Admin role grants access to specific server-side-only actions from the client. These actions are listed below:

Player

ActionDescription
player.banBans the player.
player.unbanUnbans the player.
player.getBanStatusGets the player's ban status.
player.kickKicks the player.

Storage

ActionDescription
Persistent StoreAllows the player to access a persistent store.
Memory StoreAllows the player to access a memory store.

Voicechat

ActionDescription
voicechat.setEnabledSets the global voicechat status.
voicechat.setModeSets the global voicechat mode.
voicechat.setDistanceSets the global voicechat distance.

Chat

ActionDescription
chat.setEnabledEnables or disables the chat for the server.

Player

ActionDescription
player.voicechat.setMutedSets the voicechat muted status for the player.

Players

ActionDescription
players.setNametagsDistanceSets the nametags distance for all players.
players.setStreamerDistanceSets the streamer distance for all players.

Special Actions

There are certain actions that are automatically created when you create a new server.

This will help to access certain server-side actions from the client when the player has access to these actions.

These actions are listed below:

Objects

ActionActionDescription
object.sync+editorSynchronizes an object's properties between the server and the client.
object.save+editorSaves an object to the Verza servers, making it permanent.
object.saveVolatile+editorSame as object.save but with a delay.
object.delete+editorDestroys and deletes an object from Verza servers (only for permanent objects).
object.destroy+editorDestroys an object.