Documentation menu

API Reference

Permissions

Permission groups and user permissions

GET /api/plugin/permissions/groups

List permission groups

All permission groups for the network, with their nodes.

Responses

  • 200 OK.
200 response
[
  {
    "groupId": "string",
    "displayName": "string",
    "priority": 0,
    "chatPrefix": "string",
    "chatPrefixColor": "string",
    "chatNameColor": "string",
    "permissions": [
      {
        "node": "string",
        "value": false,
        "context": "string",
        "world": "string",
        "expiresAt": 0
      }
    ]
  }
]

Request

~
curl -X GET http://localhost:8090/api/plugin/permissions/groups \
  -H "X-Hive-Api-Key: $HIVE_API_KEY"
hive.permissions().fetchAllGroups().thenAccept(groups -> {
  // Map<String, PermissionGroup> keyed by group id
});
GET /api/plugin/permissions/groups/{groupId}

Get a permission group

Returns a single group by id.

Parameters

  • groupId string path required

    Group id.

Responses

  • 200 The group.
  • 404 No group with this id.
200 response
{
  "groupId": "string",
  "displayName": "string",
  "priority": 0,
  "chatPrefix": "string",
  "chatPrefixColor": "string",
  "chatNameColor": "string",
  "permissions": [
    {
      "node": "string",
      "value": false,
      "context": "string",
      "world": "string",
      "expiresAt": 0
    }
  ]
}

Request

~
curl -X GET http://localhost:8090/api/plugin/permissions/groups/{groupId} \
  -H "X-Hive-Api-Key: $HIVE_API_KEY"
hive.permissions().fetchGroup("admin").thenAccept(group -> { });
PUT /api/plugin/permissions/groups/{groupId}

Create or replace a group

Upserts a permission group by id (the path id wins over the body).

Parameters

  • groupId string path required

    Group id.

Request body

application/json
{
  "groupId": "string",
  "displayName": "string",
  "priority": 0,
  "chatPrefix": "string",
  "chatPrefixColor": "string",
  "chatNameColor": "string",
  "permissions": [
    {
      "node": "string",
      "value": false,
      "context": "string",
      "world": "string",
      "expiresAt": 0
    }
  ]
}

Responses

  • 204 Saved.
  • 400 Bad Request

Request

~
curl -X PUT http://localhost:8090/api/plugin/permissions/groups/{groupId} \
  -H "X-Hive-Api-Key: $HIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"groupId":"string","displayName":"string","priority":0,"chatPrefix":"string","chatPrefixColor":"string","chatNameColor":"string","permissions":[{"node":"string","value":false,"context":"string","world":"string","expiresAt":0}]}'
// Upsert a group (create or replace) by its id.
hive.permissions().saveGroup(group);
DELETE /api/plugin/permissions/groups/{groupId}

Delete a group

Removes a permission group by id.

Parameters

  • groupId string path required

    Group id.

Responses

  • 204 Deleted.
  • 404 No group with this id.

Request

~
curl -X DELETE http://localhost:8090/api/plugin/permissions/groups/{groupId} \
  -H "X-Hive-Api-Key: $HIVE_API_KEY"
hive.permissions().deleteGroup("admin").thenAccept(deleted -> { });
GET /api/plugin/permissions/users/{uuid}/permissions

List a user's direct permissions

Permission nodes attached directly to a user (not via groups).

Parameters

  • uuid string path required

    Player UUID.

Responses

  • 200 OK.
200 response
[
  {
    "node": "string",
    "value": false,
    "context": "string",
    "world": "string",
    "expiresAt": 0
  }
]

Request

~
curl -X GET http://localhost:8090/api/plugin/permissions/users/{uuid}/permissions \
  -H "X-Hive-Api-Key: $HIVE_API_KEY"
hive.permissions().fetchUserPermissions(uuid).thenAccept(nodes -> { });
POST /api/plugin/permissions/users/{uuid}/permissions

Grant a user permission

Adds a permission node directly to a user.

Parameters

  • uuid string path required

    Player UUID.

Request body

application/json
{
  "node": "string",
  "value": false,
  "context": "string",
  "world": "string",
  "expiresAt": 0
}

Responses

  • 204 Granted.
  • 400 Bad Request

Request

~
curl -X POST http://localhost:8090/api/plugin/permissions/users/{uuid}/permissions \
  -H "X-Hive-Api-Key: $HIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"node":"string","value":false,"context":"string","world":"string","expiresAt":0}'
hive.permissions().addUserPermission(uuid, new PermissionNode("essentials.fly", true));
POST /api/plugin/permissions/users/{uuid}/permissions/remove

Revoke a user permission

Removes a permission node from a user.

Parameters

  • uuid string path required

    Player UUID.

Request body

application/json
{
  "node": "string",
  "value": false,
  "context": "string",
  "world": "string",
  "expiresAt": 0
}

Responses

  • 204 Revoked.
  • 400 Bad Request

Request

~
curl -X POST http://localhost:8090/api/plugin/permissions/users/{uuid}/permissions/remove \
  -H "X-Hive-Api-Key: $HIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"node":"string","value":false,"context":"string","world":"string","expiresAt":0}'
hive.permissions().removeUserPermission(uuid, new PermissionNode("essentials.fly", true));