Skip to main content

Roles, Perms and Ranks

Previous Step: Navio Integration.
You've finished both creating Discord Application and configuring Navio Integration, users will be able to sign up and log in, and their jobs will be logged. Now we'll configure the roles, permissions, and rankings, which are essential for a Drivers Hub to fully function.

Roles

Roles are assigned to members, to distinguish staff from drivers, drivers from other members. They often work with permissions, making users with the role have one or more permissions, granting them access to specific endpoints.
The roles item in config is a list. Each item of the list must follow the format below:

{
    "id": "", // integar id
    "name": "", // string name
    "color": "" // optional hex color
}

The id must be an integar, like 100. It must be unique, conflicts might lead to issues, like only the list one in the last will be considered. It should not be changed once set and given to users, if changed, an "Unknown Role" will appear and you can no longer add or remove the role from users unless the id is recovered, but the permissions will persist. It's recommended to preserve a gap of id between roles, in case you want to insert a new role in the future. Also, the id will decide the order of the role list, smaller is higher.
The color is a hex color, starting with #, like #770202. This is an optional field and might be removed. Also, color rendering is only available to Frontend V2.

For example, we want to create a green founder and a blue driver role, while founder is higher than driver, the config will be:

"roles": [{
    "id": "1",
    "name": "Founder",
    "color": "00ff00"
},{
    "id": "100",
    "name": "Driver",
    "color": "0000ff"
}]