1 | openapi: 3.1.0
|
---|
2 | info:
|
---|
3 | title: Command Permissions
|
---|
4 | version: '1'
|
---|
5 |
|
---|
6 | components:
|
---|
7 | schemas:
|
---|
8 | TypeCommandName:
|
---|
9 | type: string
|
---|
10 | pattern: '^[a-zA-Z0-9_-]+$'
|
---|
11 | examples:
|
---|
12 | - listplayers
|
---|
13 | description: Name of the command. Can be any of the command name variants.
|
---|
14 |
|
---|
15 | CommandPermissionElement:
|
---|
16 | type: object
|
---|
17 | properties:
|
---|
18 | command:
|
---|
19 | $ref: '#/components/schemas/TypeCommandName'
|
---|
20 | permissionLevel:
|
---|
21 | type: integer
|
---|
22 | description: Permission level of the command
|
---|
23 | required:
|
---|
24 | - command
|
---|
25 | - permissionLevel
|
---|
26 |
|
---|
27 | CommandPermissionList:
|
---|
28 | type: array
|
---|
29 | items:
|
---|
30 | $ref: '#/components/schemas/CommandPermissionElement'
|
---|
31 |
|
---|
32 |
|
---|
33 | requestBodies:
|
---|
34 | CommandPermissionBodyIn:
|
---|
35 | content:
|
---|
36 | application/json:
|
---|
37 | schema:
|
---|
38 | type: object
|
---|
39 | properties:
|
---|
40 | permissionLevel:
|
---|
41 | type: integer
|
---|
42 | required:
|
---|
43 | - permissionLevel
|
---|
44 | required: true
|
---|
45 |
|
---|
46 |
|
---|
47 | parameters:
|
---|
48 | CommandNamePathParameter:
|
---|
49 | name: command
|
---|
50 | in: path
|
---|
51 | required: true
|
---|
52 | schema:
|
---|
53 | $ref: '#/components/schemas/TypeCommandName'
|
---|
54 |
|
---|
55 |
|
---|
56 | paths:
|
---|
57 | /api/commandpermission:
|
---|
58 | get:
|
---|
59 | tags:
|
---|
60 | - Permissions
|
---|
61 | summary: Command permission list
|
---|
62 | description: Fetch a list of all command permissions
|
---|
63 | operationId: commandpermission.get
|
---|
64 | responses:
|
---|
65 | 200:
|
---|
66 | description: List of command permissions
|
---|
67 | content:
|
---|
68 | application/json:
|
---|
69 | schema:
|
---|
70 | type: object
|
---|
71 | properties:
|
---|
72 | data:
|
---|
73 | $ref: '#/components/schemas/CommandPermissionList'
|
---|
74 | meta:
|
---|
75 | $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
|
---|
76 | required:
|
---|
77 | - data
|
---|
78 | - meta
|
---|
79 | 403:
|
---|
80 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
81 | security:
|
---|
82 | - apiTokenName: [ ]
|
---|
83 | apiTokenSecret: [ ]
|
---|
84 | - sessionCookie: [ ]
|
---|
85 |
|
---|
86 |
|
---|
87 | /api/commandpermission/{command}:
|
---|
88 | # get:
|
---|
89 | # tags:
|
---|
90 | # - Permissions
|
---|
91 | # summary: Marker show
|
---|
92 | # description: Fetch a single defined map marker
|
---|
93 | # operationId: blacklist.get.id
|
---|
94 | # parameters:
|
---|
95 | # - $ref: '#/components/parameters/MarkerIdParameter'
|
---|
96 | # responses:
|
---|
97 | # 200:
|
---|
98 | # description: Single found marker
|
---|
99 | # $ref: '#/components/responses/MarkersBodyOut'
|
---|
100 | # 404:
|
---|
101 | # description: Marker ID not found, errorCode will be 'ID_NOT_FOUND'
|
---|
102 | # $ref: '#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
103 |
|
---|
104 | post:
|
---|
105 | tags:
|
---|
106 | - Permissions
|
---|
107 | summary: Command permission create
|
---|
108 | description: Create or update a command permission override
|
---|
109 | operationId: commandpermission.post.id
|
---|
110 | parameters:
|
---|
111 | - $ref: '#/components/parameters/CommandNamePathParameter'
|
---|
112 | requestBody:
|
---|
113 | $ref: '#/components/requestBodies/CommandPermissionBodyIn'
|
---|
114 | responses:
|
---|
115 | 201:
|
---|
116 | description: Command permission override created or updated
|
---|
117 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
118 | 400:
|
---|
119 | description: Invalid request body, errorCode will be one of 'NO_COMMAND' or 'NO_OR_INVALID_PERMISSION_LEVEL'
|
---|
120 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
121 | 404:
|
---|
122 | description: Specified command not found, errorCode will be 'INVALID_COMMAND'
|
---|
123 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
124 | 403:
|
---|
125 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
126 | security:
|
---|
127 | - apiTokenName: []
|
---|
128 | apiTokenSecret: []
|
---|
129 | - sessionCookie: []
|
---|
130 |
|
---|
131 | delete:
|
---|
132 | tags:
|
---|
133 | - Permissions
|
---|
134 | summary: Command permission delete
|
---|
135 | description: Delete a single command permission override
|
---|
136 | operationId: commandpermission.delete.id
|
---|
137 | parameters:
|
---|
138 | - $ref: '#/components/parameters/CommandNamePathParameter'
|
---|
139 | responses:
|
---|
140 | 204:
|
---|
141 | description: Deleted command permission override
|
---|
142 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
143 | 404:
|
---|
144 | description: Command not found or no permission override defined so far
|
---|
145 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
146 | 403:
|
---|
147 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
148 | security:
|
---|
149 | - apiTokenName: []
|
---|
150 | apiTokenSecret: []
|
---|
151 | - sessionCookie: []
|
---|