Create a Permission Set
post
/content/management/api/v1.1/repositories/{id}/permissionSets
Creates a permission set of the repository with the given payload.
Request
Supported Media Types
- application/json
Path Parameters
-
id: string
Repository id parameter for permission sets.
Query Parameters
-
links(optional): string
This parameter accepts a comma-separated list of link names. By default, this parameter gives all the links applicable. Possible values are: self, canonical, describedby
Header Parameters
-
X-Requested-With: string
A custom header to mitigate CSRF attacks.Allowed Values:
[ "XMLHttpRequest" ]
Creates a permission set with the given information in the payload. The fields id and links will be ignored even if given in the payload.
Root Schema : PermissionSet
Type:
object
PermissionSet
Show Source
-
contentPrivileges(optional):
array contentPrivileges
The privileges of content type.
-
id(optional):
string
The id of the permission set.
-
links(optional):
array links
Links
-
principal(optional):
object Principal
Principal
-
taxonomyPrivileges(optional):
array taxonomyPrivileges
The privileges of taxonomy.
Nested Schema : contentPrivileges
Type:
array
The privileges of content type.
Show Source
-
Array of:
object ContentPrivilege
ContentPrivilege
Nested Schema : Principal
Type:
object
Principal
Show Source
-
name(optional):
string
-
scope(optional):
string
Allowed Values:
[ "CEC", "IDP" ]
-
type(optional):
string
Allowed Values:
[ "user", "group" ]
Nested Schema : taxonomyPrivileges
Type:
array
The privileges of taxonomy.
Show Source
-
Array of:
object TaxonomyPrivilege
TaxonomyPrivilege
Nested Schema : ContentPrivilege
Type:
object
ContentPrivilege
Show Source
-
isEnabled(optional):
boolean
Whether the privilege is enabled under the context of a repository.
-
isValid(optional):
boolean
The validness of the privilege.
-
operations(optional):
array operations
Operations.
-
typeDisplayName(optional):
string
The display name of the content type.
-
typeId(optional):
string
The id of the content type.
-
typeName(optional):
string
The name of the content type.
Nested Schema : operations
Type:
array
Operations.
Show Source
-
Array of:
string
Allowed Values:
[ "view", "update", "create", "delete" ]
Nested Schema : Link
Type:
object
Link of the resource.
Show Source
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
Nested Schema : TaxonomyPrivilege
Type:
object
TaxonomyPrivilege
Show Source
-
categoryId(optional):
string
The id of the category.
-
isEnabled(optional):
boolean
Whether the privilege is enabled under the context of a repository.
-
isForSiteManagement(optional):
boolean
Whether the taxonomy is for site management.
-
isSiteCategory(optional):
boolean
Whether the category is a site category.
-
isValid(optional):
boolean
The validness of the privilege.
-
nodes(optional):
array nodes
The path of the category.
-
operations(optional):
array operations
Operations.
-
taxonomyId(optional):
string
The id of the taxonomy.
-
taxonomyShortName(optional):
string
The short name of the taxonomy.
Nested Schema : operations
Type:
array
Operations.
Show Source
-
Array of:
string
Allowed Values:
[ "view", "categorize", "createsite" ]
Nested Schema : CategoryNodeBean
Type:
Show Source
object
-
apiName(optional):
string
The apiName of the Category node.
-
id(optional):
string
The id of the Category node.
-
name(optional):
string
The name of the Category node.
Response
Supported Media Types
- application/json
201 Response
Created.
Root Schema : PermissionSet
Type:
object
PermissionSet
Show Source
-
contentPrivileges(optional):
array contentPrivileges
The privileges of content type.
-
id(optional):
string
The id of the permission set.
-
links(optional):
array links
Links
-
principal(optional):
object Principal
Principal
-
taxonomyPrivileges(optional):
array taxonomyPrivileges
The privileges of taxonomy.
Nested Schema : contentPrivileges
Type:
array
The privileges of content type.
Show Source
-
Array of:
object ContentPrivilege
ContentPrivilege
Nested Schema : Principal
Type:
object
Principal
Show Source
-
name(optional):
string
-
scope(optional):
string
Allowed Values:
[ "CEC", "IDP" ]
-
type(optional):
string
Allowed Values:
[ "user", "group" ]
Nested Schema : taxonomyPrivileges
Type:
array
The privileges of taxonomy.
Show Source
-
Array of:
object TaxonomyPrivilege
TaxonomyPrivilege
Nested Schema : ContentPrivilege
Type:
object
ContentPrivilege
Show Source
-
isEnabled(optional):
boolean
Whether the privilege is enabled under the context of a repository.
-
isValid(optional):
boolean
The validness of the privilege.
-
operations(optional):
array operations
Operations.
-
typeDisplayName(optional):
string
The display name of the content type.
-
typeId(optional):
string
The id of the content type.
-
typeName(optional):
string
The name of the content type.
Nested Schema : operations
Type:
array
Operations.
Show Source
-
Array of:
string
Allowed Values:
[ "view", "update", "create", "delete" ]
Nested Schema : Link
Type:
object
Link of the resource.
Show Source
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
Nested Schema : TaxonomyPrivilege
Type:
object
TaxonomyPrivilege
Show Source
-
categoryId(optional):
string
The id of the category.
-
isEnabled(optional):
boolean
Whether the privilege is enabled under the context of a repository.
-
isForSiteManagement(optional):
boolean
Whether the taxonomy is for site management.
-
isSiteCategory(optional):
boolean
Whether the category is a site category.
-
isValid(optional):
boolean
The validness of the privilege.
-
nodes(optional):
array nodes
The path of the category.
-
operations(optional):
array operations
Operations.
-
taxonomyId(optional):
string
The id of the taxonomy.
-
taxonomyShortName(optional):
string
The short name of the taxonomy.
Nested Schema : operations
Type:
array
Operations.
Show Source
-
Array of:
string
Allowed Values:
[ "view", "categorize", "createsite" ]
Nested Schema : CategoryNodeBean
Type:
Show Source
object
-
apiName(optional):
string
The apiName of the Category node.
-
id(optional):
string
The id of the Category node.
-
name(optional):
string
The name of the Category node.
400 Response
Bad request.
403 Response
Forbidden.
404 Response
Not found.
500 Response
Internal server error.
Examples
The following example shows how to create a permission set on a repository.
curl -X POST -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' 'https://host:port/content/management/api/v1.1/repositories/{id}/permissionSets'
Example 1
/content/management/api/v1.1/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets
This creates a permission set for a user on the repository with id 0A84F4683E51409C84C0D4AF0C23F4CF. Replace payload with your own data.
Note:
The any type rule is defined by an empty typeId; and the any category rule is defined by an empty categoryId.Request Payload
{ "principal": { "name": "cecusername", "type": "user" }, "contentPrivileges": [ { "typeId": "", "typeName": "", "operations": [ "view" ] }, { "typeId": "49B267B515C84AD7903C5B9C34EDB09E", "typeName": "TypeAAA", "operations": [ "view", "update", "create", "delete" ] }, { "typeId": "8CB7D974CBB74923BF40A6CA68BED145", "typeName": "TypeBBB", "operations": [] } ], "taxonomyPrivileges": [ { "taxonomyId": "", "categoryId": "", "operations": [ "view" ] } ] }
Response Body
{ "id": "514E1A01602042FB992C74BB999F47A9", "principal": { "name": "cecusername", "type": "user" }, "contentPrivileges": [ { "typeId": "", "typeName": null, "isValid": true, "operations": [ "view" ] }, { "typeId": "49B267B515C84AD7903C5B9C34EDB09E", "typeName": "TypeAAA", "isValid": true, "operations": [ "view", "update", "create", "delete" ] }, { "typeId": "8CB7D974CBB74923BF40A6CA68BED145", "typeName": "TypeBBB", "isValid": true, "operations": [] } ], "taxonomyPrivileges": [ { "taxonomyId": null, "taxonomyShortName": null, "isForSiteManagement": false, "categoryId": "", "nodes": null, "isSiteCategory": false, "isValid": true, "operations": [ "view" ] } ], "links": [ { "href": "http://<hostname>/content/management/api/v1.1/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets", "rel": "self", "method": "POST", "mediaType": "application/json" }, { "href": "http://<hostname>/content/management/api/v1.1/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets", "rel": "canonical", "method": "POST", "mediaType": "application/json" }, { "href": "http://<hostname>/content/management/api/v1.1/metadata-catalog/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] }
Example 2
/content/management/api/v1.1/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets
This creates a permission set with a group on the repository with id 0A84F4683E51409C84C0D4AF0C23F4CF. Replace payload with your own data.
Note:
The any type rule is defined by an empty typeId; and the any category rule is defined by an empty categoryId.Request Payload
{ "principal": { "name": "cecgroupname", "type": "group", "scope": "CEC" }, "contentPrivileges": [ { "typeId": "", "typeName": "", "operations": [ "view" ] }, { "typeId": "EF4C64E6BF81419F9743A8A4348A69EB", "typeName": "Image", "operations": [ "view", "update", "create", "delete" ] } ], "taxonomyPrivileges": [ { "taxonomyId": "", "categoryId": "", "operations": [] }, { "taxonomyId": "691B31CFB0F14381ACDF9E0CE0B63CD1", "categoryId": "CEFC8C6C2AA245AB9F719FBE9C45D88A", "operations": [ "view" ] }, { "taxonomyId": "691B31CFB0F14381ACDF9E0CE0B63CD1", "categoryId": "0EAC9A777E73415AA4BC3CDB61FBD59C", "operations": [ "view", "categorize" ] } ] }
Response Body
{ "id": "3C1B236C10C54C80AA2ADDACCAFB1B4A", "principal": { "name": "cecgroupname", "type": "group", "scope": "CEC" }, "contentPrivileges": [ { "typeId": "", "typeName": null, "isValid": true, "operations": [ "view" ] }, { "typeId": "EF4C64E6BF81419F9743A8A4348A69EB", "typeName": "Image", "isValid": true, "operations": [ "view", "update", "create", "delete" ] } ], "taxonomyPrivileges": [ { "taxonomyId": null, "taxonomyShortName": null, "isForSiteManagement": false, "categoryId": "", "nodes": null, "isSiteCategory": false, "isValid": true, "operations": [] }, { "taxonomyId": "691B31CFB0F14381ACDF9E0CE0B63CD1", "taxonomyShortName": "TXM", "isForSiteManagement": false, "categoryId": "CEFC8C6C2AA245AB9F719FBE9C45D88A", "nodes": [ { "id": "CEFC8C6C2AA245AB9F719FBE9C45D88A", "name": "Cat1", "apiName": "txm-c" } ], "isSiteCategory": false, "isValid": true, "operations": [ "view" ] }, { "taxonomyId": "691B31CFB0F14381ACDF9E0CE0B63CD1", "taxonomyShortName": "TXM", "isForSiteManagement": false, "categoryId": "0EAC9A777E73415AA4BC3CDB61FBD59C", "nodes": [ { "id": "0EAC9A777E73415AA4BC3CDB61FBD59C", "name": "Cat2", "apiName": "txm-c1" } ], "isSiteCategory": false, "isValid": true, "operations": [ "view", "categorize" ] } ], "links": [ { "href": "http://<hostname>/content/management/api/v1.1/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets", "rel": "self", "method": "POST", "mediaType": "application/json" }, { "href": "http://<hostname>/content/management/api/v1.1/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets", "rel": "canonical", "method": "POST", "mediaType": "application/json" }, { "href": "http://<hostname>/content/management/api/v1.1/metadata-catalog/repositories/0A84F4683E51409C84C0D4AF0C23F4CF/permissionSets", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] }
Example 3
/content/management/api/v1.1/repositories/50109217E930462096BC76722F0AD739/permissionSets
This creates a permission set for a user on the repository with id 50109217E930462096BC76722F0AD739, which includes a taxonomy rule with createSite permission. Replace payload with your own data.
Note:
The any type rule is defined by an emptytypeId
; and the any category rule is defined by an empty
categoryId
.
Request Payload
{ "principal": { "name": "cecuser2", "type": "user" }, "contentPrivileges": [ { "typeId": "", "typeName": "", "isValid": true, "operations": [ "view", "update", "create", "delete" ] } ], "taxonomyPrivileges": [ { "taxonomyId": "", "categoryId": "", "isValid": true, "operations": [ "view", "categorize" ] }, { "taxonomyId": "AF6B75DBBCA244FC93166610EA2BA62A", "categoryId": "F54C934D081B4768B3A93A45C0E6955C", "isValid": true, "operations": [ "view", "categorize", "createSite" ] } ] }
Request Headers
{ "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" }
Response Body
{ "id": "68CE607F31614F2B84C542D87518F4D3", "principal": { "name": "cecuser2", "type": "user" }, "contentPrivileges": [ { "typeId": "", "typeName": null, "typeDisplayName": null, "isValid": true, "operations": [ "view", "update", "create", "delete" ] } ], "taxonomyPrivileges": [ { "taxonomyId": null, "taxonomyShortName": null, "isForSiteManagement": false, "categoryId": "", "nodes": null, "isSiteCategory": false, "isValid": true, "operations": [ "view", "categorize" ] }, { "taxonomyId": "AF6B75DBBCA244FC93166610EA2BA62A", "taxonomyShortName": "SST", "isForSiteManagement": true, "categoryId": "F54C934D081B4768B3A93A45C0E6955C", "nodes": [ { "id": "BE58B209A968480480AA2AFBCE9C2D64", "name": "org1", "apiName": "sst-o" }, { "id": "F54C934D081B4768B3A93A45C0E6955C", "name": "team1", "apiName": "sst-o-d" } ], "isSiteCategory": false, "isValid": true, "operations": [ "view", "categorize", "createSite" ] } ], "links": [ { "href": "http://<hostname>/content/management/api/v1.1/repositories/50109217E930462096BC76722F0AD739/permissionSets", "rel": "self", "method": "POST", "mediaType": "application/json" }, { "href": "http://<hostname>/content/management/api/v1.1/repositories/50109217E930462096BC76722F0AD739/permissionSets", "rel": "canonical", "method": "POST", "mediaType": "application/json" }, { "href": "http://<hostname>/content/management/api/v1.1/metadata-catalog/repositories/50109217E930462096BC76722F0AD739/permissionSets", "rel": "describedby", "method": "GET", "mediaType": "application/json" } ] }