RoleResource Resource

Resource for management of roles

GET /role

Get list of roles.
The result can be filtered by

  • id
  • name
  • description
and sorted by
  • id
  • name
  • description

Request Parameters
name type description default constraints
page query Returned page, if paging is used. Paging starts with 1 1 int
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int
perms query Flag to add permission information for the returned items. false boolean
q query Query string for filtering    
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name  
Response Codes
code condition
200 List of roles is returned.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json RoleListResponse (JSON) list response

Example

Request
GET /role
Content-Type: */*
Accept: application/json

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

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "updateinheritance", "deleteform" ],
    "property2" : [ "setperm", "deleteform" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

PUT /role

Create new role

Request Body
media type data type description
application/json RoleModel (JSON) role
Response Codes
code condition
200 Role {id} was created.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json RoleResponse (JSON) response containing created role

Example

Request
PUT /role
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : {
    "property1" : "...",
    "property2" : "..."
  },
  "description" : {
    "property1" : "...",
    "property2" : "..."
  }
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "role" : {
    "id" : 12345,
    "name" : {
      "property1" : "...",
      "property2" : "..."
    },
    "description" : {
      "property1" : "...",
      "property2" : "..."
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /role/{id}

Delete a role

Request Parameters
name type description
id path role ID
Response Codes
code condition
204 Role {id} was deleted.
404 Role {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json object (JSON) empty response

Example

Request
DELETE /role/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

GET /role/{id}

Get existing role

Request Parameters
name type description
id path role ID
Response Codes
code condition
200 Role {id} exists.
404 Role {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json RoleResponse (JSON) response containing the role

Example

Request
GET /role/{id}
Content-Type: */*
Accept: application/json

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

                
{
  "role" : {
    "id" : 12345,
    "name" : {
      "property1" : "...",
      "property2" : "..."
    },
    "description" : {
      "property1" : "...",
      "property2" : "..."
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /role/{id}

Update a role

Request Parameters
name type description
id path role ID
Request Body
media type data type description
application/json RoleModel (JSON) updated role data
Response Codes
code condition
200 Role {id} was updated.
404 Role {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json RoleResponse (JSON) response containing the updated role

Example

Request
POST /role/{id}
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : {
    "property1" : "...",
    "property2" : "..."
  },
  "description" : {
    "property1" : "...",
    "property2" : "..."
  }
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "role" : {
    "id" : 12345,
    "name" : {
      "property1" : "...",
      "property2" : "..."
    },
    "description" : {
      "property1" : "...",
      "property2" : "..."
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /role/{id}/perm

Get role permissions

Request Parameters
name type description
id path role ID
Response Codes
code condition
200 Role {id} exists.
404 Role {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json RolePermResponse (JSON) role permissions

Example

Request
GET /role/{id}/perm
Content-Type: */*
Accept: application/json

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

                
{
  "perm" : {
    "page" : {
      "viewpage" : true,
      "createpage" : true,
      "updatepage" : true,
      "deletepage" : true,
      "publishpage" : true,
      "translatepage" : true
    },
    "pageLanguages" : {
      "property1" : {
        "viewpage" : true,
        "createpage" : true,
        "updatepage" : true,
        "deletepage" : true,
        "publishpage" : true,
        "translatepage" : true
      },
      "property2" : {
        "viewpage" : true,
        "createpage" : true,
        "updatepage" : true,
        "deletepage" : true,
        "publishpage" : true,
        "translatepage" : true
      }
    },
    "file" : {
      "viewfile" : true,
      "createfile" : true,
      "updatefile" : true,
      "deletefile" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /role/{id}/perm

Update role permissions

Request Parameters
name type description
id path role ID
Request Body
media type data type description
application/json RolePermissionsModel (JSON) permissions
Response Codes
code condition
200 Role {id} permissions were updated.
404 Role {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json RolePermResponse (JSON) updated permissions

Example

Request
POST /role/{id}/perm
Content-Type: application/json
Accept: application/json

                
{
  "page" : {
    "viewpage" : true,
    "createpage" : true,
    "updatepage" : true,
    "deletepage" : true,
    "publishpage" : true,
    "translatepage" : true
  },
  "pageLanguages" : {
    "property1" : {
      "viewpage" : true,
      "createpage" : true,
      "updatepage" : true,
      "deletepage" : true,
      "publishpage" : true,
      "translatepage" : true
    },
    "property2" : {
      "viewpage" : true,
      "createpage" : true,
      "updatepage" : true,
      "deletepage" : true,
      "publishpage" : true,
      "translatepage" : true
    }
  },
  "file" : {
    "viewfile" : true,
    "createfile" : true,
    "updatefile" : true,
    "deletefile" : true
  }
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "perm" : {
    "page" : {
      "viewpage" : true,
      "createpage" : true,
      "updatepage" : true,
      "deletepage" : true,
      "publishpage" : true,
      "translatepage" : true
    },
    "pageLanguages" : {
      "property1" : {
        "viewpage" : true,
        "createpage" : true,
        "updatepage" : true,
        "deletepage" : true,
        "publishpage" : true,
        "translatepage" : true
      },
      "property2" : {
        "viewpage" : true,
        "createpage" : true,
        "updatepage" : true,
        "deletepage" : true,
        "publishpage" : true,
        "translatepage" : true
      }
    },
    "file" : {
      "viewfile" : true,
      "createfile" : true,
      "updatefile" : true,
      "deletefile" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}