Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
The "Permission - Create Multiple" operation allows users to create multiple permission entries in bulk for a system that manages collections, roles, and actions. This node is useful when you need to set or update access controls for various roles across different collections efficiently, rather than creating permissions one by one.
Practical examples include:
- Assigning read and create permissions on a "pages" collection to a specific role.
- Setting field-level permissions for roles on multiple collections simultaneously.
Properties
Name | Meaning |
---|---|
Data (JSON) | An array of partial permission objects. Each object must specify the collection (the target data collection), action (the type of permission such as read, create, update, delete), and role (the identifier of the role to which the permission applies). Optionally, fields can be specified to restrict the permission to certain fields within the collection. |
Example value for "Data (JSON)":
[
{
"collection": "pages",
"action": "read",
"role": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7",
"fields": ["id", "title"]
},
{
"collection": "pages",
"action": "create",
"role": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7",
"fields": ["id", "title"]
}
]
Output
The output will contain JSON data representing the created permission objects. Each object corresponds to a permission entry created based on the input array. The structure typically includes identifiers and details of the newly created permissions.
If the node supports binary data output, it would represent any associated files or attachments related to permissions, but this operation primarily deals with JSON data.
Dependencies
- Requires an API authentication token or API key credential to interact with the permissions management system.
- Depends on the external service's API endpoint that handles permission creation.
- The node uses bundled methods and routing logic internally but requires proper configuration of credentials and endpoint URLs in n8n.
Troubleshooting
- Invalid JSON Input: If the "Data (JSON)" property contains malformed JSON, the node will fail. Ensure the JSON is valid and matches the expected schema.
- Missing Required Fields: Each permission object must include at least
collection
,action
, androle
. Omitting these will cause errors. - Insufficient Permissions: The API user must have rights to create permissions; otherwise, the request will be denied.
- API Errors: Network issues or incorrect API endpoint configurations can cause failures. Verify connectivity and credentials.
- Field Restrictions: Specifying invalid fields in the
fields
array may result in errors if those fields do not exist in the target collection.
Links and References
- Directus Permissions API Documentation - Detailed explanation of permission objects and their properties.