source: TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/UserPermissions.openapi.yaml@ 474

Last change on this file since 474 was 462, checked in by alloc, 16 months ago

More OpenAPI specs added

File size: 8.0 KB
RevLine 
[462]1openapi: 3.1.0
2info:
3 title: User Permissions
4 version: '1'
5
6components:
7 schemas:
8 UserPermissionElement:
9 type: object
10 properties:
11 name:
12 type: string
13 examples:
14 - TheFunPimp
15 description: Name of the player for display purposes. Can be empty.
16 userId:
17 $ref: './openapi.yaml#/components/schemas/TypeUserIdObject'
18 permissionLevel:
19 type: integer
20 required:
21 - name
22 - userId
23 - permissionLevel
24
25 UserPermissionList:
26 type: array
27 items:
28 $ref: '#/components/schemas/UserPermissionElement'
29
30 GroupPermissionElement:
31 type: object
32 properties:
33 name:
34 type: string
35 examples:
36 - Steam Universe
37 description: Name of the group for display purposes. Can be empty.
38 groupId:
39 type: string
40 examples:
41 - '103582791434672565'
42 permissionLevelMods:
43 type: integer
44 examples:
45 - 10
46 description: Permission levels that mods of the group get assigned
47 permissionLevelNormal:
48 type: integer
49 examples:
50 - 500
51 description: Permission levels that regular members of the group get assigned
52 required:
53 - name
54 - groupId
55 - permissionLevelMods
56 - permissionLevelNormal
57
58 GroupPermissionList:
59 type: array
60 items:
61 $ref: '#/components/schemas/GroupPermissionElement'
62
63 UserPermissionsObject:
64 type: object
65 properties:
66 users:
67 $ref: '#/components/schemas/UserPermissionList'
68 groups:
69 $ref: '#/components/schemas/GroupPermissionList'
70 required:
71 - users
72 - groups
73
74 TypeGroupIdString:
75 type: string
76 examples:
77 - '103582791434672565'
78
79 UserPermissionPostBodyUserObject:
80 type: object
81 properties:
82 permissionLevel:
83 type: integer
84 name:
85 type: string
86 required:
87 - permissionLevel
88
89 UserPermissionPostBodyGroupObject:
90 type: object
91 properties:
92 permissionLevelMods:
93 type: integer
94 examples:
95 - 10
96 permissionLevelNormal:
97 type: integer
98 examples:
99 - 500
100 name:
101 type: string
102 examples:
103 - Steam Universe
104 required:
105 - permissionLevelMods
106 - permissionLevelNormal
107
108
109 parameters:
110 UserIdParameter:
111 name: id
112 in: path
113 required: true
114 schema:
115 $ref: './openapi.yaml#/components/schemas/TypeUserIdString'
116
117 GroupIdParameter:
118 name: id
119 in: path
120 required: true
121 schema:
122 $ref: '#/components/schemas/TypeGroupIdString'
123
124
125 requestBodies:
126 UserPermissionBodyIn:
127 content:
128 application/json:
129 schema:
130 $ref: '#/components/schemas/UserPermissionPostBodyUserObject'
131 required: true
132
133 GroupPermissionBodyIn:
134 content:
135 application/json:
136 schema:
137 $ref: '#/components/schemas/UserPermissionPostBodyGroupObject'
138 required: true
139
140
141paths:
142 /api/userpermissions:
143 get:
144 tags:
145 - Permissions
146 summary: User permission list
147 description: Fetch a list of all user / group permissions
148 operationId: userpermissions.get
149 responses:
150 200:
151 description: List of user permissions
152 content:
153 application/json:
154 schema:
155 type: object
156 properties:
157 data:
158 $ref: '#/components/schemas/UserPermissionsObject'
159 meta:
160 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
161 required:
162 - data
163 - meta
164 403:
165 $ref: './openapi.yaml#/components/responses/Unauthorized'
166 security:
167 - apiTokenName: [ ]
168 apiTokenSecret: [ ]
169 - sessionCookie: [ ]
170
171
172 /api/userpermissions/user/{id}:
173 post:
174 tags:
175 - Permissions
176 summary: User permission create
177 description: Create or update a user permission
178 operationId: userpermissions.post.user.id
179 parameters:
180 - $ref: '#/components/parameters/UserIdParameter'
181 requestBody:
182 $ref: '#/components/requestBodies/UserPermissionBodyIn'
183 responses:
184 201:
185 description: User permission created or updated
186 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
187 400:
188 description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP', 'INVALID_USER' or 'NO_OR_INVALID_PERMISSION_LEVEL'
189 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
190 403:
191 $ref: './openapi.yaml#/components/responses/Unauthorized'
192 security:
193 - apiTokenName: []
194 apiTokenSecret: []
195 - sessionCookie: []
196
197 delete:
198 tags:
199 - Permissions
200 summary: User permission delete
201 description: Delete a single user permission
202 operationId: userpermissions.delete.user.id
203 parameters:
204 - $ref: '#/components/parameters/UserIdParameter'
205 responses:
206 204:
207 description: Deleted user permission
208 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
209 400:
210 description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP' or 'INVALID_USER'
211 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
212 404:
213 description: User ID not found
214 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
215 403:
216 $ref: './openapi.yaml#/components/responses/Unauthorized'
217 security:
218 - apiTokenName: []
219 apiTokenSecret: []
220 - sessionCookie: []
221
222
223 /api/userpermissions/group/{id}:
224 post:
225 tags:
226 - Permissions
227 summary: Group permission create
228 description: Create or update a group permission
229 operationId: userpermissions.post.group.id
230 parameters:
231 - $ref: '#/components/parameters/GroupIdParameter'
232 requestBody:
233 $ref: '#/components/requestBodies/GroupPermissionBodyIn'
234 responses:
235 201:
236 description: Group permission created or updated
237 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
238 400:
239 description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP', 'INVALID_GROUP', 'NO_OR_INVALID_PERMISSION_LEVEL_MODS' or 'NO_OR_INVALID_PERMISSION_LEVEL_NORMAL'
240 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
241 403:
242 $ref: './openapi.yaml#/components/responses/Unauthorized'
243 security:
244 - apiTokenName: []
245 apiTokenSecret: []
246 - sessionCookie: []
247
248 delete:
249 tags:
250 - Permissions
251 summary: Group permission delete
252 description: Delete a single group permission
253 operationId: userpermissions.delete.group.id
254 parameters:
255 - $ref: '#/components/parameters/GroupIdParameter'
256 responses:
257 204:
258 description: Deleted group permission
259 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
260 400:
261 description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP', 'INVALID_GROUP'
262 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
263 404:
264 description: Group ID not found
265 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
266 403:
267 $ref: './openapi.yaml#/components/responses/Unauthorized'
268 security:
269 - apiTokenName: []
270 apiTokenSecret: []
271 - sessionCookie: []
Note: See TracBrowser for help on using the repository browser.