Class Permissions
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.TableServletBase
-
- nzilbb.labbcat.server.api.admin.roles.Permissions
-
@RequiredRole("admin") public class Permissions extends TableServletBase
/api/admin/roles/permissions[/role_id[/entity]] : Administration role permissions records.Allows administration (Create/Read/Update/Delete) of user role permission records via JSON-encoded objects with the following attributes:
- role_id
- The ID of the role this permission applies to.
- entity
- The media entity this permission applies to - a string made up of "t" (transcript), "a" (audio), "v" (video), or "i" (image).
- attribute_name
- Name of a transcript attribute for which the value determines access. This is either a valid transcript attribute name (i.e. excluding the "transcript_" prefix in the layer ID), or "corpus".
- value_pattern
- Regular expression for matching against the attribute_name value. If the regular expression matches the value, access is allowed.
- _cantDelete
- This is not a database field, but rather is present in records returned from the server that can not currently be deleted; a string representing the reason the record can't be deleted.
The following operations, specified by the HTTP method, are supported:
- POST
- Create a new record.
- Request Body - a JSON-encoded object representing the new record (excluding role_id).
- Response Body - the standard JSON envelope, with the model as an object representing the new record (including role_id).
- Response Status
- 200 : The record was successfully created.
- 409 : The record could not be added because it was already there.
- GET
- Read the records.
- Request Path - /api/admin/roles/permissions/role_id where role_id is the ID of the role the permissions belong to.
- Parameters
- pageNumber (integer) : The (zero-based) page to return.
- pageLength (integer) : How many rows per page (default is 20).
- Accept (string) : Equivalent of the "Accept" request header (see below).
- "Accept" request header/parameter "text/csv" to return records as Comma Separated Values. If not specified, records are returned as a JSON-encoded array of objects.
- Response Body - the standard JSON envelope, with the model as a corresponding list of records.
- Response Status
- 200 : The records could be listed.
- PUT
- Update an existing record, specified by the role given in the
request body.
- Request Body - a JSON-encoded object representing the record.
- Response Body - the standard JSON envelope, with the model as an object representing the record.
- Response Status
- 200 : The record was successfully updated.
- 404 : The record was not found.
- DELETE
- Delete an existing record.
- Request Path - /api/admin/roles/permissions/role_id/entity where role_id is the ID of the role the permissions belong to and entity is the entity to delete the permission for..
- Response Body - the standard JSON envelope, including a message if the request succeeds or an error explaining the reason for failure.
- Response Status
- 200 : The record was successfully deleted.
- 400 : No role was specified in the URL path, or the record exists but could not be deleted.
- 404 : The record was not found.
- Author:
- Robert Fromont robert@fromont.net.nz
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class nzilbb.labbcat.server.api.TableServletBase
TableServletBase.DeleteCheck
-
-
Field Summary
-
Fields inherited from class nzilbb.labbcat.server.api.APIRequestHandler
SC_BAD_REQUEST, SC_CONFLICT, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_METHOD_NOT_ALLOWED, SC_NOT_FOUND, SC_OK, SC_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description Permissions()
-
Method Summary
-
Methods inherited from class nzilbb.labbcat.server.api.TableServletBase
delete, get, post, put
-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
GetSystemAttribute, init, writeResponse
-
-