Permissions
register plugin permission
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.
After a permission has been registered you'll then find a mapping section under plugin settings > permissions
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
hasPermissionDetermine if current user has permissions
Last updated