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
-
200OK.
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
-
groupIdstring path requiredGroup id.
Responses
-
200The group. -
404No 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
-
groupIdstring path requiredGroup 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
-
204Saved. -
400Bad 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
-
groupIdstring path requiredGroup id.
Responses
-
204Deleted. -
404No 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
-
uuidstring path requiredPlayer UUID.
Responses
-
200OK.
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
-
uuidstring path requiredPlayer UUID.
Request body
application/json
{
"node": "string",
"value": false,
"context": "string",
"world": "string",
"expiresAt": 0
} Responses
-
204Granted. -
400Bad 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
-
uuidstring path requiredPlayer UUID.
Request body
application/json
{
"node": "string",
"value": false,
"context": "string",
"world": "string",
"expiresAt": 0
} Responses
-
204Revoked. -
400Bad 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));