PermResource Resource

Resource for reading and writing permissions.

The following table can be used to look up the bit positions (starting at 0) of the folder permissions:

TypeShortDescriptionBit
FoldersShow0
rAssign user permissions1
cCreate8
eEdit9
dDelete10
Pages/Images/FilessShow11
cCreate12
eEdit13
dDelete14
iImport23
PagespPublish19
TemplatessShow15
cCreate16
lLink21
eEdit17
dDelete18
WorkflowvLink22

The following table can be used to look up the bit positions (starting at 0) of the role permissions:

TypeDescriptionBit
Role permissionsShow10
Create11
Modify12
Delete13
Publishing14
Translate15

GET /perm/{type}/{id}

Get the permission bits valid for the current user on the given object (and optionally for the given node).

See the class description for the permission bits.
To get the folder permissions you need to provide the type (10002 = Folder, 10001 = Node) and the object id.
To get the role permissions you need to provide the languageId and the type to check for (10007 = Pages, 10008 = Files).

Request Parameters
name type description default constraints
id path object id   int
type path object type (10002 = Folder, 10001 = Node)   int
lang query optional language id for which the role permissions should be returned 0 int
map query true if the privileges should also be returned as map false boolean
nodeId query optional node id 0 int
type query optional type for which the role permission should be returned (10007 = Pages, 10008 = Files) -1 int
Response Body
media type data type description
application/json PermBitsResponse (JSON) permission bits response

Example

Request
GET /perm/{type}/{id}
Accept: application/json

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

                
{
  "perm" : "...",
  "rolePerm" : "...",
  "privilegeMap" : {
    "privileges" : {
      "property1" : true,
      "property2" : true
    },
    "languages" : [ {
      "language" : { },
      "privileges" : {
        "property1" : true,
        "property2" : true
      }
    }, {
      "language" : { },
      "privileges" : {
        "property1" : true,
        "property2" : true
      }
    } ]
  },
  "messages" : [ {
    "fieldName" : "...",
    "message" : "...",
    "type" : "CRITICAL",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  }, {
    "fieldName" : "...",
    "message" : "...",
    "type" : "WARNING",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  } ],
  "responseInfo" : {
    "responseCode" : "PERMISSION",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /perm/{perm}/{type}/{id}

Check whether the user has permission perm on the object defined by type and id

Request Parameters
name type description default constraints
id path object id   int
perm path permission   "create" or "delete" or "edit" or "publish" or "view"
type path object type   int
nodeId query node id 0 int
Response Body
media type data type description
application/json PermResponse (JSON) response containing the result

Example

Request
GET /perm/{perm}/{type}/{id}
Accept: application/json

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

                
{
  "granted" : true,
  "messages" : [ {
    "fieldName" : "...",
    "message" : "...",
    "type" : "INFO",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  }, {
    "fieldName" : "...",
    "message" : "...",
    "type" : "CRITICAL",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  } ],
  "responseInfo" : {
    "responseCode" : "FAILURE",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /perm/{type}/{id}

Set the permissions on the identified object according to the posted request

Request Parameters
name type description constraints
id path object id int
type path object type int
Request Body
media type data type description
application/json SetPermsRequest (JSON) request
Response Body
media type data type description
application/json GenericResponse (JSON) generic response

Example

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

                
{
  "perm" : "...",
  "groupId" : 12345,
  "subGroups" : true,
  "subObjects" : true,
  "roleIds" : [ 12345, 12345 ]
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "messages" : [ {
    "fieldName" : "...",
    "message" : "...",
    "type" : "NEUTRAL",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  }, {
    "fieldName" : "...",
    "message" : "...",
    "type" : "INFO",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  } ],
  "responseInfo" : {
    "responseCode" : "PERMISSION",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /perm/list/{type}

List all groups with with their permission bits for the given object type This only lists groups that the current user actually has permission to view (his own groups and their sub groups)

Request Parameters
name type description constraints
type path Type of the object int
Response Body
media type data type description
application/json GroupsPermBitsResponse (JSON) generic GroupsPermBitsResponse object

Example

Request
GET /perm/list/{type}
Accept: application/json

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

                
{
  "groups" : {
    "property1" : "...",
    "property2" : "..."
  },
  "messages" : [ {
    "fieldName" : "...",
    "message" : "...",
    "type" : "CRITICAL",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  }, {
    "fieldName" : "...",
    "message" : "...",
    "type" : "SUCCESS",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  } ],
  "responseInfo" : {
    "responseCode" : "FAILURE",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /perm/list/{type}/{id}

List all groups with with their permission bits for the given object This only lists groups that the current user actually has permission to view (his own groups and their sub groups)

Request Parameters
name type description constraints
id path ID of the object int
type path Type of the object int
Response Body
media type data type description
application/json GroupsPermBitsResponse (JSON) generic GroupsPermBitsResponse object

Example

Request
GET /perm/list/{type}/{id}
Accept: application/json

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

                
{
  "groups" : {
    "property1" : "...",
    "property2" : "..."
  },
  "messages" : [ {
    "fieldName" : "...",
    "message" : "...",
    "type" : "NEUTRAL",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  }, {
    "fieldName" : "...",
    "message" : "...",
    "type" : "SUCCESS",
    "timestamp" : 12345,
    "image" : "...",
    "sender" : {
      "id" : 12345,
      "firstName" : "...",
      "lastName" : "...",
      "description" : "...",
      "email" : "...",
      "groups" : [ { }, { } ],
      "login" : "...",
      "password" : "..."
    },
    "id" : 12345
  } ],
  "responseInfo" : {
    "responseCode" : "MAINTENANCEMODE",
    "responseMessage" : "...",
    "property" : "..."
  }
}