Skip to content

Creation of groups with contexts as non-admin user

Administrators are able to create groups and contexts through the usual API, but there are use cases where even non-admin users may want to create a group with linked home context.

This feature needs to be explicitly activated in the configuration:

entrystore.nonadmin.group-context-creation=on|off (default: off)

In 6.x, true, yes and 1 also activate the feature, and an unrecognised value makes startup fail (see Settings).

The request below creates a group and a context. The requesting user is given administrative rights on both the context and the group and becomes a member of the group. The newly created group get write access on the context's resource, and the context becomes the group's home context.

POST {base}/_principals/groups?name=name-group-and-context[&contextId=projectx]

The optional parameter name determines the name of the newly created group and context.

The optional parameter contextId allows to manually set the ID of the newly created context.

In 6.x, name may only contain letters, digits, spaces, dots, hyphens and underscores, and contextId only letters, digits, hyphens and underscores. Both must be at most 64 characters long, contain at least one letter or digit, must not start with an underscore and must not be a reserved name.

The return values are:

  • 201: Group and context successfully created. Contains the group's entry URI in the HTTP location header.
  • 400: (6.x) name or contextId is invalid.
  • 401: The requesting user must be logged in.
  • 403: The feature is not activated and the requesting user is not an admin.
  • 409: A group or context with the provided name or contextId exists already.
  • 500: Internal server error.

EntryStore 5.x

5.x answers requests of users that are not logged in with 403.