Actions in CKAN

Actions are essentially the API endpoints or operations that can be performed within the CKAN system. These actions are exposed through the CKAN Action API, allowing users and applications to interact with the CKAN instance programmatically. Actions can be categorised into several groups:

  1. Dataset Actions: Operations related to datasets, such as creating, updating, deleting, and searching datasets.
  2. Resource Actions: Operations related to resources (the actual data files), such as creating, updating, and deleting resources associated with datasets.
  3. Group and Organization Actions: Operations to manage groups and organisations within CKAN.
  4. User Actions: Operations to manage users, such as creating users, updating user information, and managing user permissions.
  5. System Actions: Operations for system-wide configurations and maintenance tasks.

Each action is usually named following a convention, such as group_create, package_create, package_update, user_create, organization_list, etc.

Authorisation in CKAN

Authorisations in CKAN determine whether a user has permission to perform a specific action. The authorisation system in CKAN is highly customisable and allows for fine-grained control over what actions a user can perform. Key concepts in CKAN’s authorisation system include:

  1. Roles: CKAN defines several default roles, such as admin, editor, member, and reader, each with varying levels of permissions.
    • Admin: Has full control over the organisation or dataset.
    • Editor: Can create and edit datasets and resources.
    • Member: Can view private datasets within the organisation.
  2. Permissions: These are the specific rights granted
    • System Level: Permissions that apply to the entire CKAN instance.
    • Organisation Level: Permissions that apply within a specific organisation.
    • Dataset Level: Permissions specific to individual datasets.
  3. Authorisation Checks: When a user attempts to perform an action
    • Checking the user’s role and the permissions associated with that role.
    • Evaluating custom authorisation functions or rules, if configured.
  4. Authorisation Functions: CKAN allows the implementation of custom authorisation logic through authorisation functions, which can be defined in CKAN extensions. These functions can be used to implement complex authorisation rules that go beyond the default role-based permissions.

Example Scenario #1 – Create a Package

Consider an example where a user wants to create a new dataset. The following steps outline the action and authorisation process:

  1. Action Invocation: The user calls the package_create action through the CKAN API or web interface.
  2. Authorization Check: CKAN checks if the user has the create package permission.
    • If the user is an admin or editor in the relevant organisation, they typically have this permission.
    • If custom authorisation functions are defined, CKAN evaluates these to decide.
  3. Action Execution: If the user is authorised, the package_create action is executed, and the dataset is created. If not, an authorisation error is returned.

By managing actions and authorisations, CKAN ensures secure and organised access to data and resources, enabling effective data management and collaboration.

Example Scenario #2 – Create a new Group

Consider an example where a user wants to create a new group. The following steps outline the action and authorisation process:

  1. Action Invocation: The user calls the group_list action through the CKAN API or web interface.
  2. Authorization Check: CKAN checks if the user has the list group permission.
    • If the user is an admin or editor in the relevant organisation, they typically have this permission.
    • If custom authorisation functions are defined, CKAN evaluates these to decide.
  3. Action Execution: If the user is authorised, the group_list action is executed, and the list of datasets in the group is returned. If not, an authorisation error is returned.

That’s it! You can also watch the 16-minute video on Link Digital YouTube Channel

In case you missed the previous tutorials, go to the main article to explore more topics.


The world of open data and data management is constantly evolving. Link Digital provides insights to help you stay updated. Subscribe to our newsletter.