Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
michael.vidal edited this page Jun 19, 2017 · 2 revisions

The Groups resource provide methods to read and create groups as well as associate roles to groups.

Get

This method allows client applications to retrieve a group and is associated roles/permissions.

GET /groups/{groupName}

Parameters

Name Location Type Description
groupName path string The group to retreive

Authorization

This request requires authorization with the following scopes:

  • fabric/authorization.read

Request Body

Do not supply a request body with this method

Responses

200

[
  {
    "groupName": string,
    "roles": [
        {
            "id": guid,
            "grain": string,
            "securableItem": string,
            "name": string,
            "permissions": [
            {
                "id": guid,
                "grain": string,
                "securableItem": string,
                "name": string
            }
            ]
        }
        ]
  }
]

403 Forbidden

A Forbidden response will be returned in the following cases:

  • If the access token can not be validated (i.e. is forged or doesn't have the correct scope)

Post

This method allows clients to add groups to the Authorization service store.

POST /groups/

Parameters

Name Location Type Description
None N/A N/A N/A

Authorization

This request requires authorization with the following scopes:

  • fabric/authorization.write

Request Body

{
    "groupName": string
}

Responses

201

A 201 created response will be returned if the group is successfully created and will include the group object that was created:

{
    "id": Guid,
    "groupName": string
}

400

A 400 Bad Request will be returned in the following cases:

  • If the request is malformed
  • If the group already exists

403 Forbidden

A Forbidden response will be returned in the following cases:

  • If the access token can not be validated (i.e. is forged or doesn't have the correct scope)

Post

This method allows clients to add roles to groups that exist in the Authorization service store.

POST /groups/{groupName}/roles

Parameters

Name Location Type Description
groupName path string The group to add roles to

Authorization

This request requires authorization with the following scopes:

  • fabric/authorization.write

Request Body

[
  {
    "id": guid,
    "grain": string,
    "securableItem": string,
    "name": string
  }
]

Responses

204

A 204 No Content response will be returned if the roles are added to the group successfully.

400

A 400 Bad Request will be returned in the following cases:

  • If the request is malformed
  • If the group or role doesn't exist

403 Forbidden

A Forbidden response will be returned in the following cases:

  • If the grain/securableItem on the roles to be added does not match the clientid presented
  • If the access token can not be validated (i.e. is forged or doesn't have the correct scope)

Delete

DELETE /groups/{groupName}

Parameters

Name Location Type Description
groupName path guid The name of the group to delete

Authorization

This request requires authorization with the following scopes:

  • fabric/authorization.write

Request Body

Do not supply a request body with this method

Responses

204

A 204 no content response will be returned if the group is successfully deleted.

400

A 400 Bad Request response will be returned in the following cases:

  • The group being deleted does not exist in the Authorization service data store
  • The request is malformed

403 Forbidden

A Forbidden response will be returned in the following cases:

  • If the access token can not be validated (i.e. is forged or doesn't have the correct scope)

Delete

This method allows clients to delete roles from a group that exist in the Authorization service store.

DELETE /groups/{groupName}/roles

Parameters

Name Location Type Description
groupName path string The group to delete the roles from

Authorization

This request requires authorization with the following scopes:

  • fabric/authorization.write

Request Body

[
  {
    "id": guid,
    "grain": string,
    "securableItem": string,
    "name": string
  }
]

Responses

204

A 204 No Content response will be returned if the roles are deleted from the group successfully.

400

A 400 Bad Request will be returned in the following cases:

  • If the request is malformed
  • If the role or group doesn't exist

403 Forbidden

A Forbidden response will be returned in the following cases:

  • If the requested grain/securableItem does not match the clientid presented
  • If the access token can not be validated (i.e. is forged or doesn't have the correct scope)