> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/dashboard-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/dashboard-plugin/api-and-gui/api/register/permissions.md).

# Permissions

## What is permissions?

In order for each plugin to be able to react to different signed in roles there's a permissions section. This means that you as an plugin developer can register named permissions which then can be mapped and later queried in your plugin in order to determine if the current user is of a specific role allowed to see/use a certain feature.

### Example

> Registering a plugin with permissions.

```javascript
import DashboardPlugin from 'Dashboard/plugin'

const Plugin = new DashboardPlugin('@plugin_bundle')

const registerPlugin = () => {
    const { Application } = require('@components/Application')
    
    Plugin.register({
        application: Application,

        permissionKeys: [
            {
                id: 'PERMISSION_TO_CREATE_ID',
                label: 'Create stuff',
                description: 'a description describing what this does'
            },
            {
                id: 'PERMISSION_TO_UPDATE_ID',
                label: 'Update stuff',
                description: 'a description describing what this does'
            }
        ]
    })
}

registerPlugin()

export {
    Plugin
}
```

After a permission has been registered you'll then find a mapping section under **plugin settings** > **permissions**&#x20;

<div align="left"><img src="/files/-LpZr04smU437fujNOxM" alt="An overview of the permissions configuration for the plugin"></div>

Dashboard has four pre-defined roles, Admin, Power user, User and Readonly. Each authenticated user will get mapped into a specific role, which will allow a user of the plugin to configure which user who will get access to a specific function within the plugin. By default all permissions are empty which mean no one has permission to use the locked down feature.

## Get mapped roles

In your plugin you'll be able to see the current user has the specific role thats mapped to the permission. This in order for you to either allow/disallow that the function is called or even if a component should be rendered at all.

### Example

> Determine if current user has permissions

{% content-ref url="/pages/-MCgbTxqqyl5Qfi2HrF\_" %}
[hasPermission](/dashboard-plugin/api-and-gui/api/haspermission.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.navigaglobal.com/dashboard-plugin/api-and-gui/api/register/permissions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
