This resource contains information about permissions for each user that includes: read/write repository access and access to deployments.
id | integer | Unique ID of the Permission. |
---|---|---|
repository_id | integer | ID of the Repository to which permissions are granted. |
user_id | integer | ID of the User to whom permissions have been granted. |
server_environment_id | integer | ID of ServerEnvironment to which User should have access. If specified, allows user to create and retry deployments. Does not allow viewing incidents or changing any deployments settings. Can not be set together with |
full_deployments_access | boolean | True if allow full access to Repository’s deployments. Includes: managing environments and servers; viewing incidents; creating and retrying deployments. Automatically sets |
deploy_only_access | boolean | True if allow user to view repository’s deployments activity and issue deployments. |
read | boolean | True if allow read-access to Repository. |
write | boolean | True if allow read and write access to Repository. |
When setting permissions for Deployments you only have to specify one of the attributes: server_environment_id
,
full_deployments_access
or deploy_only_access
.
repository_id | integer | Required on create. |
---|---|---|
user_id | integer | Required on create. |
deploy_only_access | boolean | Optional. |
server_environment_id | integer | Optional. Overwrites deploy_only_access . |
full_deployments_access | boolean | Optional. Overwrites server_environment_id and deploy_only_access . |
read | boolean | Optional. |
write | boolean | Optional. |
Admins can view permissions for any user of the account. Regular users can find their permissions only.
GET /api/permissions/{USER_ID}.json
Click to expand…
json http-response[
{
"permission": {
"read": true,
"server_environment_id": null,
"id": 3,
"user_id": 7,
"write": true,
"repository_id": 3,
"full_deployments_access": false
}
}
]
GET /api/permissions/{USER_ID}.xml
Click to expand…
xml http-response<?xml version="1.0" encoding="UTF-8"?>
<permissions type="array">
<permission>
<id type="integer">9732462</id>
<user-id type="integer">259</user-id>
<repository-id type="integer">22</repository-id>
<read type="boolean">true</read>
<write type="boolean">true</write>
<full-deployments-access type="boolean">false</full-deployments-access>
<server-environment-id type="integer" nil="true"></server-environment-id>
</permission>
</permissions>
Admin privileges required for this API method.
With this method you can specify user’s permissions for a specific repository.
You can specify as many or as little attributes as you need. This method will reset any existing permissions user might have before creating new ones.
POST /api/permissions.json
{
"permission": {
"user_id": 324324,
"repository_id": 34324,
"write": true,
"server_environment_id": 3434
}
}
Click to expand…
json http-response{
"permission": {
"read": true,
"server_environment_id": null,
"id": 3,
"user_id": 7,
"write": true,
"repository_id": 3,
"full_deployments_access": false
}
}
POST /api/permissions.xml
<?xml version="1.0" encoding="UTF-8"?>
<permission>
<user-id type="integer">5638</user-id>
<repository-id type="integer">11</repository-id>
<write type="boolean">true</write>
<server-environment-id type="integer">362</server-environment-id>
</permission>
Click to expand…
xml http-response<?xml version="1.0" encoding="UTF-8"?>
<permission>
<id type="integer">9732462</id>
<user-id type="integer">5638</user-id>
<repository-id type="integer">11</repository-id>
<read type="boolean">true</read>
<write type="boolean">true</write>
<full-deployments-access type="boolean">false</full-deployments-access>
<server-environment-id type="integer">362</server-environment-id>
</permission>
Admin privileges required for this API method.
This method allows you to remove any permissions for a specified user in a specified repository.
DELETE /api/permissions/{PERMISSION_ID}.json
Click to expand…
json http-responseHEAD OK
--OR IF INVALID--
{
"errors": ["Name can't be blank"]
}
DELETE /api/permissions/{PERMISSION_ID}.xml
Click to expand…
xml http-responseHEAD OK
--OR IF INVALID--
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Delete failed. Please try again later.</error>
</errors>