Sorry, no results found for "".
Some methods and properties available within the hooks require special permissions to be accessed, as they may cause security issues.
If a plugin wants to access these additional features, it must request specific permissions. When installing the plugin, the user must explicitly grant these permissions, otherwise the installation process will be aborted:
At the moment, only one special permit is available, but in the future more may be added.
currentUserAccessToken
This permission makes the ctx.currentUserAccessToken
property available. This token represents the currently logged in user, and you can use it to make API calls to the Content Management API on behalf of that user.
During the creation of a plugin, it is possible to specify the additional permissions the plugin requires:
Public plugins must declare their additional permissions inside the datocmsPlugin.permission
key in their package.json
file:
1{2 "name": "datocms-plugin-foobar",3 "version": "0.1.0",4 "dependencies": {5 // ...6 },7 "datoCmsPlugin": {8 "title": "Foobar",9 // ...10 "permissions": ["currentUserAccessToken"]11 }12}
For more information regarding how to publish a plugin in the Marketplace, see here.