Actions118
- Item Actions
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Server Actions
- Setting Actions
- User Actions
- Utility Actions
- Webhook Actions
Permission → Create Multiple
AI-generatedOverview
This node operation allows creating multiple permission objects in the Directus system at once. It is useful for batch setting up or updating access controls for various collections, actions, roles, and fields in a single API call. For example, you can define multiple permissions for different roles on collections like 'pages' with specific actions such as 'read' or 'create' and specify which fields are accessible.
Use Case Examples
- Creating multiple permissions for a role to read and create entries in the 'pages' collection, specifying accessible fields like 'id' and 'title'.
- Batch updating permissions for different roles and collections to streamline access control management.
Properties
| Name | Meaning |
|---|---|
| Data (JSON) | An array of partial permission objects to be created. Each object must include 'action' and 'collection' fields, and can specify 'role' and 'fields' to define the permission scope. |
Output
JSON
id- The unique identifier of the created permission object.collection- The collection to which the permission applies.action- The action allowed by the permission (e.g., read, create).role- The role to which the permission is assigned.fields- The specific fields within the collection that the permission covers.
Dependencies
- Requires an API key credential for Directus to authenticate and authorize the creation of permissions via the Directus API.
Troubleshooting
- Ensure the JSON data array is correctly formatted and includes required fields 'action' and 'collection' for each permission object.
- Verify that the API key credential has sufficient permissions to create permissions in Directus.
- Common error messages may include validation errors if required fields are missing or if the role or collection specified does not exist. Check the Directus API documentation for detailed error codes and messages.
Links
- Directus Permission Object Documentation - Official documentation describing the structure and usage of permission objects in Directus.