Actions

Actions can be configured in the backend. Each actions defines an id, a title and the required permissions to decide if the action will be available for a user. Actions are sorted by categories.

Actions can be used to build UI elements that adapt to the available actions. An example is the toolbar where the “object_tabs” (view, edit, folder contents, sharing) and the “user_actions” (login, logout, preferences) are used to display the user only the actions that are allowed for the currently logged in user.

The available actions for the currently logged in user can be retrieved by calling the @actions endpoint on a specific context. This also works for not authenticated users.

Listing available actions

To list the available actions, send a GET request to the @actions endpoint on a specific content object:

GET /@actions HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImZ1bGxuYW1lIjoiQWRtaW4iLCJpYXQiOjE2NDkzMTI0NDl9.RS1Ny_r0v7vIylFfK6q0JVJrkiDuTOh9iG9IL8xbzAk

The server will respond with a 200 OK status code. The JSON response contains the available actions categories (object, object_buttons, user) on the top level. Each category contains a list of the available actions in that category:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "object": [
    {
      "id": "view",
      "title": "View",
      "url": null
    },
    {
      "id": "edit",
      "title": "Edit",
      "url": null
    },
    {
      "id": "folderContents",
      "title": "Contents",
      "url": null
    },
    {
      "id": "history",
      "title": "History",
      "url": null
    },
    {
      "id": "local_roles",
      "title": "Sharing",
      "url": null
    },
    {
      "id": "contentrules",
      "title": "Rules",
      "url": null
    }
  ],
  "site_actions": [
    {
      "id": "sitemap",
      "title": "Sitemap",
      "url": null
    },
    {
      "id": "accessibility",
      "title": "Accessibility",
      "url": null
    },
    {
      "id": "contact",
      "title": "Contact",
      "url": null
    }
  ],
  "object_buttons": [
    {
      "id": "cut",
      "title": "Cut",
      "url": null
    },
    {
      "id": "copy",
      "title": "Copy",
      "url": null
    },
    {
      "id": "paste",
      "title": "Paste",
      "url": null
    },
    {
      "id": "delete",
      "title": "Delete",
      "url": null
    },
    {
      "id": "rename",
      "title": "Rename",
      "url": null
    }
  ],
  "user": [
    {
      "id": "preferences",
      "title": "Preferences",
      "url": null
    },
    {
      "id": "plone_setup",
      "title": "Site Setup",
      "url": null
    },
    {
      "id": "logout",
      "title": "Log out",
      "url": null
    }
  ]
}