We have implemented a custom permissions system that allows users to give others access to individual commands.
Users with Discord administrator permissions and server owners are ignored by the permissions system. They have to execute any command.
The bot first checks if the user is the owner of the server or has a role with Discord Administrator permissions. If this isn't the case, it checks what permissions have been granted to the user directly and to their roles. If any of their roles have permission, he will be able to execute the command that requires that permission.
The user has Role A and Role B. Role A has been granted the MANAGE_TASKS and MANAGE_PROJECTS permissions. Role B has only been granted the EDIT_TASK permission and no others. Because the user has both roles, they can create tasks, edit tasks and create projects.
Permissions can be granted by running the
permission grant command. After a
permission was added, the bot will apply the changes immediately and the user can run the command that requires the
Permissions can be revoked by executing the
permission revoke command.
Even after revoking a user's permissions, they may still have access to certain commands through their roles that provide the same permissions.
|SET_STATE||Is required to update the state (todo, in progress, done) of a task.||Task Manager|
|MANAGE_TASKS||Is required to create, delete and restore a new task.||Task Manager|
|EDIT_TASKS||Is required to edit a task.||Task Manager|
|ASSIGN_TASK||Is required to add an assignee to a task.||Task Manager|
|UNASSIGN_TASK||Is required to remove an assignee from a task.||Task Manager|
|VIEW_TASKS||Is required to view tasks (for example via "/task list")||Task Manager|
|CREATE_PERSONAL_PROJECTS||Is required to create a personal project||Task Manager & Knowledge Manager|
|MANAGE_PERMISSIONS||Is required to show all permissions, grant or revoke permissions||Task Manager & Knowledge Manager|
|MANAGE_PROJECTS||Is required to create, rename, delete and restore projects.||Task Manager & Knowledge Manager|
|SET_LANGUAGE||Is required to use the ||Task Manager & Knowledge Manager|
|MANAGE_LOGGING||Is required to use the ||Task Manager|
|MANAGE_DOCUMENTS||Is required if a user needs to create, edit, change the topic, delete and restore a document.||Knowledge Manager|
|READ_DOCUMENTS||Is required to read a document and list all documents.||Knowledge Manager|
|MANAGE_TOPICS||Is required to create, rename, delete and restore a topic and all of its documents.||Knowledge Manager|
All permissions can be granted to a user or role for a specific project. This means that the user or role will only have access to the command if they specify the project in the command or have the project selected. This will work only on commands that have a project option. Use it with caution.
To understand the concept of permissions, take a look at this page.
Permission presets are an easy way to grant a user or role multiple permissions at once. They can be used to grant a basic set of permissions to a user or role specific to a role in the server.
When a preset is applied, all permissions that are already granted to the user or role will be removed and replaced with the permissions of the preset. After applying a preset, more permissions can be granted to the user or role. The permissions granted by the preset can be revoked too.
|Preset name||Permissions granted|
|admin||Includes every permission available|