Roles

The Roles resource contains a list of all the valid EMu groups. The list of roles is extracted from the EMu registry each time a request is made. The resulting roles are not cached.

A typical role record looks like:

{
    "id": "emu:/museum/roles/admin",
    "version": 1,
    "data": {
        "name": "admin",
        "description": "Role admin as defined in the EMu registry",
        "members": [
            {
                "name": "emu",
                "user": "emu:/museum/users/emu"
            },
            {
                "name": "barney",
                "user": "emu:/museum/users/barney"
            },
            {
                "name": "john.smith@museum.org",
                "user": "emu:/museum/users/john.smith@museum.org"
            },
        ]
    }
}

The properties are defined as:

Name Description
name EMu group name
description role description
members list of all users in the role
members/name username of member
members/user URI for the member

The following requests are available for the roles resource.

Retrieve

GET /{tenant}/roles[?select={selectlist}]
GET /{tenant}/roles/{role}[?select={selectlist}]

The GET method retrieves information about EMu groups. The first form retrieves all the EMu groups along with each groups membership information, while the second form retrieves the information for a single group.

By default all values in the record are returned. You can limit the values returned using the select query parameter. The parameter takes a comma separated list of field names. The field names are that of the enveloped record so most field names will start with data.. The Select Syntax section provides a complete description of acceptable values for the select query parameter.

A 200 status is returned along with the group(s) details for successful requests.

Example URI

GET /museum/roles/conservation

Headers

Authorization: Bearer {token}
Prefer: representation=minimal

Response 200

{
    "id": "emu:/museum/roles/conservation",
    "version": 1,
    "data": {
        "name": "conservation",
        "description": "Role conservation as defined in the EMu registry",
        "members": [
            {
                "name": "barney",
                "user": {
                    "id": "emu:/museum/users/barney",
                    "@controls": {
                        "self": {
                            "href": "http://swanston.melbourne.axiell.com:8084/museum/users/barney"
                        }
                    }
                }
            }
        ]
    },
    "@namespaces": {
        "emu": {
            "name": "http://axiell.com/emu#"
        }
    },
    "@controls": {
        "self": {
            "href": "http://swanston.melbourne.axiell.com:8084/museum/roles/conservation"
        },
        "start": {
            "method": "GET",
            "href": "http://swanston.melbourne.axiell.com:8084/"
        },
        "search": {
            "method": "GET",
            "href": "http://swanston.melbourne.axiell.com:8084/museum/roles"
        }
    }
}

Response Headers

Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}