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/@groups HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

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

httpie

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

python-requests

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

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

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

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