Skip to content

0.7 Permissions

Kurtis Nusbaum edited this page Jun 26, 2013 · 5 revisions

Back to 0.7 API

Permissions are used to control which users can preform which actions on a given player. Permissions are granted on a group by group basis, i.e. a given permission is assigned a set of groups. Each group is a list of users. Groups may overlap. If a user is in any of the groups assigned to a particular permission, that user is allowed perform the operation to which the permission refers. If a given permission for a player has no groups assigned to it, any user participating with the player may perform the associated action. Valid player permissions are laid out in the documentation for the Player Permissions JSON object section.

Endpoints:

/players/player_id/permissions

GET

Retrieves Player Permission objects representing all of the permission settings for this player.

/players/player_id/permission_groups

Follows List Semantics.

Note that creating a group deviates slightly from regular list semantics and looks like the following:

PUT

Creates a new permission group. Must be given JSON with the following structure:

{
	'name' : desired group name
}

Success - HTTP 201

The group is created

Errors

  • HTTP 400 - Bad Request - If the JSON is malformed
  • HTTP 409 - Conflict - If the player already has a permissions group with the desired group name
  • HTTP 415 - Unsupported Media Type - The request did not set the content-type header to text/json

/players/player_id/my_permission_groups

GET

Returns a JSON array of Permission Group objects which represent the permission groups for the player specified by player_id to which the calling user belongs.

/players/player_id/permissions/permission_name/groups

Follows List Semantics.

A list of groups that have this particular permission for this player.