Roles

Available roles in a Plone site can be queried by interacting with the /@roles endpoint on portal root (requires an authenticated user):

List Roles

To retrieve a list of all roles in the portal, call the /@roles endpoint with a GET request:

http

GET /plone/@roles HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i http://nohost/plone/@roles -H 'Accept: application/json' --user admin:secret

httpie

http http://nohost/plone/@roles Accept:application/json -a admin:secret

python-requests

requests.get('http://nohost/plone/@roles', headers={
    'Accept': 'application/json',
}, auth=('admin', 'secret'))

The server will respond with a list of all roles in the portal:

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

[
  {
    "@id": "http://localhost:55001/plone/@roles/Contributor", 
    "@type": "role", 
    "id": "Contributor", 
    "title": "Contributor"
  }, 
  {
    "@id": "http://localhost:55001/plone/@roles/Editor", 
    "@type": "role", 
    "id": "Editor", 
    "title": "Editor"
  }, 
  {
    "@id": "http://localhost:55001/plone/@roles/Member", 
    "@type": "role", 
    "id": "Member", 
    "title": "Member"
  }, 
  {
    "@id": "http://localhost:55001/plone/@roles/Reader", 
    "@type": "role", 
    "id": "Reader", 
    "title": "Reader"
  }, 
  {
    "@id": "http://localhost:55001/plone/@roles/Reviewer", 
    "@type": "role", 
    "id": "Reviewer", 
    "title": "Reviewer"
  }, 
  {
    "@id": "http://localhost:55001/plone/@roles/Site Administrator", 
    "@type": "role", 
    "id": "Site Administrator", 
    "title": "Site Administrator"
  }, 
  {
    "@id": "http://localhost:55001/plone/@roles/Manager", 
    "@type": "role", 
    "id": "Manager", 
    "title": "Manager"
  }
]

The role title is the translated role title as displayed in Plone’s “Users and Groups” control panel.