ACL

API Endpoint
acl

ACL Module API documentation.

Users

Users

GET acl/users
Responses200
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": 4,
      "email": "coen@pixelindustries.com",
      "first_name": "Coen",
      "last_name": "Zimmerman",
      "roles": [
        "admin"
      ]
    },
    {
      "id": 6,
      "email": "test@testing.nl",
      "first_name": "Tester T.",
      "last_name": "Testington",
      "roles": [
        "editor"
      ]
    }
  ]
}

Retrieve all users
GET/users

Retrieves a full unpaginated list of users.


POST acl/users
RequestsFull dataMinimal data
Headers
Content-Type: application/json
Body
{
    "email": "someuser@somedomain.com",
    "password" "secret",
    "first_name": "Some",
    "last_name": "User",
    "roles": [
        "admin",
        "editor"
    ]
}
Responses201
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 9,
    "email": "someuser@somedomain.com",
    "first_name": "Some",
    "last_name": "User",
    "roles": [
      "admin",
      "editor"
    ]
  }
}
Headers
Content-Type: application/json
Body
{
    "email": "someuser@somedomain.com",
    "password" "secret"
}
Responses201
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 9,
    "email": "someuser@somedomain.com",
    "first_name": "Some",
    "last_name": "User",
    "roles": [
      "admin",
      "editor"
    ]
  }
}

Create a user
POST/users

Create a new user, which may log in immediately after.


Single User

GET acl/users/1
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 9,
  "email": "someuser@somedomain.com",
  "first_name": "Some",
  "last_name": "User",
  "roles": [
    "admin",
    "editor"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "email": {
      "type": "string",
      "description": "Valid e-mail address"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    },
    "roles": {
      "type": "array",
      "description": "A list of the roles currently assigned to the user"
    }
  },
  "required": [
    "id"
  ]
}

Retrieve a user
GET/users/{userId}

Retrieves a single user.

URI Parameters
HideShow
userId
number (required) Example: 1

ID of the user


PUT acl/users/1
RequestsFull dataUpdate roles onlyNew password only
Headers
Content-Type: application/json
Body
{
  "password": "newsecret",
  "first_name": "New",
  "last_name": "Name",
  "roles": [
    "editor"
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 4,
    "email": "coen@pixelindustries.com",
    "first_name": "Coen",
    "last_name": "Zimmerman",
    "roles": [
      "admin"
    ]
  }
}
Headers
Content-Type: application/json
Body
{
  "roles": [
    "editor"
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 4,
    "email": "coen@pixelindustries.com",
    "first_name": "Coen",
    "last_name": "Zimmerman",
    "roles": [
      "admin"
    ]
  }
}
Headers
Content-Type: application/json
Body
{
    "password" "newsecret"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 4,
    "email": "coen@pixelindustries.com",
    "first_name": "Coen",
    "last_name": "Zimmerman",
    "roles": [
      "admin"
    ]
  }
}

Update a user
PUT/users/{userId}

Updates a user.

Note that a user’s e-mail address may not be changed. If new roles are set, any roles omitted will be unassigned.

URI Parameters
HideShow
userId
number (required) Example: 1

ID of the user


DELETE acl/users/1
Responses204
This response has no content.

Delete a user
DELETE/users/{userId}

Deletes a user. This instantly voids any open sessions and denies all access this user may have had.

URI Parameters
HideShow
userId
number (required) Example: 1

ID of the user


Roles

Roles

GET acl/roles
Responses200
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "key": "admin",
      "permissions": [
        "acl.roles.show",
        "acl.roles.edit",
        "acl.roles.create",
        "acl.roles.delete",
        "acl.users.show"
      ]
    },
    {
      "key": "editor",
      "permissions": [
        "acl.roles.show",
        "acl.users.show"
      ]
    }
  ]
}

Retrieve all roles
GET/roles

Retrieves a list of all roles.


POST acl/roles
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "key": "admin",
  "name": "Administrator",
  "permissions": [
    "acl.users.show",
    "acl.roles.show"
  ]
}
Responses201
Headers
Content-Type: application/json
Body
{
  "data": {
    "key": "admin",
    "permissions": [
      "acl.users.show",
      "acl.roles.show"
    ]
  }
}

Create a role
POST/roles

Creates a new role.


Single Role

GET acl/roles/admin
Responses200
Headers
Content-Type: application/json
Body
{
  "key": "admin",
  "permissions": [
    "acl.roles.show",
    "acl.users.show"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "key": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "description": "A list of the permissions that the role offers"
    }
  },
  "required": [
    "key"
  ]
}

Retrieve a role
GET/roles/{roleKey}

Retrieves a single role by its key.

URI Parameters
HideShow
roleKey
string (required) Example: admin

Key of the role


PUT acl/roles/admin
Responses200
Body
{
  "data": {
    "key": "editor",
    "permissions": [
      "acl.roles.show",
      "acl.users.show"
    ]
  }
}

Update a role
PUT/roles/{roleKey}

Updates a role.

URI Parameters
HideShow
roleKey
string (required) Example: admin

Key of the role


DELETE acl/roles/admin
Responses204412
This response has no content.
Body
{
  "message": "Role is still in use"
}

Delete a role
DELETE/roles/{roleKey}

Deletes a role. Roles which are still in use (assigned to any user) are NOT deleted.

URI Parameters
HideShow
roleKey
string (required) Example: admin

Key of the role


Permissions

Permissions

GET acl/permissions
Responses200
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "key": "do.something"
    },
    {
      "key": "acl.roles.show"
    },
    {
      "key": "acl.roles.create"
    },
    {
      "key": "acl.roles.edit"
    },
    {
      "key": "acl.roles.delete"
    },
    {
      "key": "acl.users.show"
    },
    {
      "key": "acl.users.create"
    },
    {
      "key": "acl.users.edit"
    },
    {
      "key": "acl.users.delete"
    }
  ]
}

Retrieve all available permissions
GET/permissions

Retrieves all permissions that are defined by loaded CMS modules. This will exclude any permissions set for users or roles that are not currently defined by modules.


Permissions per module

GET acl/permissions/module/
Responses200
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "key": "acl.roles.show"
    },
    {
      "key": "acl.roles.create"
    },
    {
      "key": "acl.roles.edit"
    },
    {
      "key": "acl.roles.delete"
    }
  ]
}

Retrieve available permissions for a single module
GET/permissions/module/

Returns all permissions defined for a single module.

Module permissions are defined by their ACL presence data. This endpoint will return a flattened list of all permissions related to a single module.


Permissions in use

GET acl/permissions/used
Responses200
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "key": "acl.roles.show"
    },
    {
      "key": "acl.roles.edit"
    }
  ]
}

Retrieve all permissions in use
GET/permissions/used

Retrieves permissions in use, regardless of whether they are considered available or not. This will only return the permissions that are currently assigned to any roles (or users).


Generated by aglio on 04 Aug 2016