OpenFolia

Lock a module or manual for a change set

POST
/change-sets/{changeSetId}/locks

Takes the lock on the subject for the change set, recorded with a lock.acquire audit event: 201 with the new lock. A subject the change set holds already is answered 200 with its lock (nothing changes). Only the change set’s author takes locks for it (403; for an actor without content.read.draft another author’s change set is 404, exactly like a missing one), only while it is a draft. The subject, as committed on the change set’s branch, must lie within a role holding content.edit and be one the actor reads; a subject with nothing committed only for an actor who edits and reads all of its language (a module) or manuals of every audience. Else 403, one answer whatever the reason. Needs the content.edit permission.

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Path Parameters

changeSetId*string

The change set’s ID (a UUID). One that names no change set, malformed or not, is 404.

Formatuuid

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Request Body

application/vnd.api+json
  1. body
data*

Response Body

The change set held the lock already.

application/vnd.api+json
  1. response
data*
Example Request
curl -X POST 'http://localhost:3000/change-sets/497f6eca-6276-4993-bfeb-53cbbbba6f08/locks' \  -H 'Content-Type: application/vnd.api+json' \  -d '{  "data": {    "type": "Lock",    "attributes": {      "subject": {        "type": "module",        "lang": "string",        "moduleId": "string"      }    }  }}'
Example Response
{  "data": {    "type": "Lock",    "id": "string",    "attributes": {      "subject": {        "type": "module",        "lang": "string",        "moduleId": "string"      },      "holder": {        "kind": "user",        "id": "string"      },      "since": "2019-08-24T14:15:22Z"    },    "relationships": {      "changeSet": {        "data": {          "type": "ChangeSet",          "id": "string"        }      }    }  }}