Add role hoisting / ranking.

This commit is contained in:
Paul
2021-08-11 14:16:16 +01:00
parent e9c638b126
commit 0602c5936c
4 changed files with 140 additions and 32 deletions
+118 -19
View File
@@ -3,7 +3,7 @@
"openapi": "3.0.0",
"info": {
"title": "Revolt API",
"version": "0.5.1-alpha.22",
"version": "0.5.1-alpha.24",
"description": "User-first privacy focused chat platform built with modern web technologies.\n\n# Authentication\n\nCurrently all relevant requests are authenticated by the use of two headers which identify a session.\n\n<SecurityDefinitions />",
"termsOfService": "https://revolt.chat/terms",
"contact": {
@@ -8766,25 +8766,50 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"description": "Role name",
"minLength": 1,
"maxLength": 32,
"type": "string"
"allOf": [
{
"$ref": "#/definitions/RoleInformation"
},
"colour": {
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"remove": {
"description": "Field to remove from role object",
"type": "string",
"enum": [
"Colour"
{
"type": "object",
"properties": {
"remove": {
"description": "Field to remove from role object",
"type": "string",
"enum": [
"Colour"
]
}
}
}
],
"definitions": {
"RoleInformation": {
"type": "object",
"properties": {
"name": {
"description": "Role name",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"colour": {
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"hoist": {
"description": "Whether to display this role separately on the members list",
"type": "boolean"
},
"rank": {
"description": "Role ranking\n\nA role with a smaller number will have permissions over roles with larger numbers.",
"type": "number"
}
},
"required": [
"name"
]
}
}
@@ -9719,6 +9744,9 @@
"type": "object",
"properties": {
"name": {
"description": "Role name",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"permissions": {
@@ -9740,6 +9768,14 @@
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"hoist": {
"description": "Whether to display this role separately on the members list",
"type": "boolean"
},
"rank": {
"description": "Role ranking\n\nA role with a smaller number will have permissions over roles with larger numbers.",
"type": "number"
}
},
"required": [
@@ -14682,6 +14718,9 @@
"type": "object",
"properties": {
"name": {
"description": "Role name",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"permissions": {
@@ -14703,6 +14742,14 @@
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"hoist": {
"description": "Whether to display this role separately on the members list",
"type": "boolean"
},
"rank": {
"description": "Role ranking\n\nA role with a smaller number will have permissions over roles with larger numbers.",
"type": "number"
}
},
"required": [
@@ -14723,6 +14770,47 @@
}
}
},
"RoleInformation": {
"type": "object",
"properties": {
"name": {
"description": "Role name",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"colour": {
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"hoist": {
"description": "Whether to display this role separately on the members list",
"type": "boolean"
},
"rank": {
"description": "Role ranking\n\nA role with a smaller number will have permissions over roles with larger numbers.",
"type": "number"
}
},
"required": [
"name"
],
"definitions": {
"AttachmentTag": {
"description": "Attachment tag",
"enum": [
"attachments",
"avatars",
"backgrounds",
"banners",
"icons"
],
"type": "string"
}
}
},
"Category": {
"type": "object",
"properties": {
@@ -14893,6 +14981,9 @@
"type": "object",
"properties": {
"name": {
"description": "Role name",
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"permissions": {
@@ -14914,6 +15005,14 @@
"minLength": 1,
"maxLength": 32,
"type": "string"
},
"hoist": {
"description": "Whether to display this role separately on the members list",
"type": "boolean"
},
"rank": {
"description": "Role ranking\n\nA role with a smaller number will have permissions over roles with larger numbers.",
"type": "number"
}
},
"required": [