Skip to content

REST: Environment access restrictions

bugzmanov edited this page Aug 14, 2012 · 2 revisions

Preconditions

System property genesis.system.security.environment.restriction.enabled must be set to true (app restart required).

User must have project admin role (or be a system admin)

Get list of users and groups that can access environment

Path: /rest/projects/(projectId)/envs/(envId)/access

Type: GET

Response body

consists form a single JSON map contains the following entries:

Entry name Type Mandatory Description
users List of strings Y List of usernames
groups List of string Y List of group names

Example:

Response:

  {
    "users": ["ninja"],
    "groups": ["some group"]
  }

Set list of users and groups that can access environment

Path: /rest/projects/(projectId)/envs/(envId)/access

Type: PUT

Request body

consists form a single JSON map contains the following entries:

Entry name Type Mandatory Description
users List of strings Y List of usernames
groups List of string Y List of group names

Example:

Request:

  {
    "users": ["ninja"],
    "groups": ["some group"]
  }

Response:

{
    "serviceErrors":{},
    "variablesErrors":{},
    "compoundServiceErrors":[],
    "compoundVariablesErrors":[],
    "isSuccess":true,
    "isNotFound":false
}
Clone this wiki locally