Don't allow list modifier in role name

This commit is contained in:
amcmanu3 2024-06-21 14:00:06 -04:00
parent 76c64b8ac4
commit bd73e1892a
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ create_role_schema = {
"name": {
"type": "string",
"minLength": 1,
"pattern": r"^[^,\[\]]*$",
},
"servers": {
"type": "array",
@ -22,7 +23,7 @@ create_role_schema = {
},
"permissions": {
"type": "string",
"pattern": "^[01]{8}$", # 8 bits, see EnumPermissionsServer
"pattern": r"^[01]{8}$", # 8 bits, see EnumPermissionsServer
},
},
"required": ["server_id", "permissions"],

View File

@ -9,6 +9,7 @@ modify_role_schema = {
"name": {
"type": "string",
"minLength": 1,
"pattern": r"^[^,\[\]]*$",
},
"servers": {
"type": "array",
@ -21,7 +22,7 @@ modify_role_schema = {
},
"permissions": {
"type": "string",
"pattern": "^[01]{8}$", # 8 bits, see EnumPermissionsServer
"pattern": r"^[01]{8}$", # 8 bits, see EnumPermissionsServer
},
},
"required": ["server_id", "permissions"],