Permissions
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.
How does it work?
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.
Example
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 SET_STATE permission and no others. Because the user has both roles, they can create tasks, set tasks state and create projects.
Grant permissions
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
permission.
Revoke permissions
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.
Project based permissions
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.
The project will be determined by the following order:
- The project specified in the command
- The project of a task that is specified in the command
- When a project could be specified in the command, but isn’t, the user’s selected project will be used
Whichever condition is met first will be used to determine the project.
Permission presets
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.
Available presets
Preset name | Permissions granted |
---|---|
admin | Includes every permission available |
contributor | - MANAGE_TOPICS - MANAGE_DOCUMENTS - READ_DOCUMENTS - MANAGE_TASKS - VIEW_TASKS - SET_STATE - CREATE_PERSONAL_PROJECTS - MANAGE_MILESTONES |
guest | - VIEW_TASKS - READ_DOCUMENTS |
How does it work?
Bot | Permission | Use case |
---|---|---|
Task Manager | VIEW_TASKS | Is required to view tasks (for example via “/task list” and for viewing projects) |
Task Manager | SET_STATE | Is required to update the state (todo, in progress, done) of a task. |
Task Manager | MANAGE_TASKS | Is required to create, delete, edit, assign, unassign and restore a task. |
Task Manager | MANAGE_MILESTONES | Required to create, edit or delete milestones |
Knowledge Manager | READ_DOCUMENTS | Is required to read a document and list all documents and viewing projects |
Knowledge Manager | MANAGE_DOCUMENTS | Is required if a user needs to create, edit, change the topic, delete and restore a document. |
Knowledge Manager | MANAGE_TOPICS | Is required to create, rename, delete and restore a topic and all of its documents. |
Task Manager, Knowledge Manager | MANAGE_PROJECTS | Is required to create, rename, delete and restore projects. |
Task Manager, Knowledge Manager | CREATE_PERSONAL_PROJECTS | Is required to create a personal project |
Calendar Manager | CREATE_EVENTS | Is required to create a new event. |
Task Manager, Calendar Manager, Knowledge Manager | MANAGE_PERMISSIONS | Is required to show all permissions, grant or revoke permissions |
Task Manager, Calendar Manager, Knowledge Manager | MANAGE_SETTINGS | Required to change settings by the /settings command |
Example
To understand the concept of permissions, take a look at the permissions page.
Command Options
Required | Name | Description |
---|---|---|
Yes | mentionable | The user or role to grant the permission to. |
Yes | permission | The permission to grant. |
No | project | A name of an existing project if the permissions should be granted only on a project level. |
Command Options
Required | Name | Description |
---|---|---|
Yes | mentionable | The user or role to revoke the permission from. |
Yes | permission | The permission to revoke. |
No | project | A name of an existing project if the permissions should be revoked only on a project level. |
Command Options
Required | Name | Description |
---|---|---|
Yes | mentionable | The user or role to list permissions for. |
No | project | A name of an existing project if the permissions should be listed only on a project level. |
Command Options
Required | Name | Description |
---|---|---|
Yes | preset | The name of the preset to apply. |
Yes | mentionable | The user or role to apply the preset to. |
No | project | A name of an existing project if the preset should be applied only on a project level. |