aboutsummaryrefslogtreecommitdiffstats
path: root/templates/swagger
diff options
context:
space:
mode:
authorRomain <romdum@users.noreply.github.com>2021-10-12 12:47:19 +0200
committerGitHub <noreply@github.com>2021-10-12 12:47:19 +0200
commitd0a681fbc3fb626adcddbbb13f8c96c0bbd72c02 (patch)
treeed807f45d54993e20f63af81d9d964ddc2f258fe /templates/swagger
parent7b8723158e2a50834617f47b07c29f5436fede6d (diff)
downloadgitea-d0a681fbc3fb626adcddbbb13f8c96c0bbd72c02.tar.gz
gitea-d0a681fbc3fb626adcddbbb13f8c96c0bbd72c02.zip
[API] Add endpount to get user org permissions (#17232)
* Add endpoint * Add swagger response + generate swagger * Stop execution if user / org is not found * Add tests Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'templates/swagger')
-rw-r--r--templates/swagger/v1_json.tmpl72
1 files changed, 72 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index c6fa664af6..afb93c50fe 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -11856,6 +11856,45 @@
}
}
},
+ "/users/{username}/orgs/{org}/permissions": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Get user permissions in organization",
+ "operationId": "orgGetUserPermissions",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "username of user",
+ "name": "username",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/OrganizationPermissions"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/users/{username}/repos": {
"get": {
"produces": [
@@ -15877,6 +15916,33 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "OrganizationPermissions": {
+ "description": "OrganizationPermissions list differents users permissions on an organization",
+ "type": "object",
+ "properties": {
+ "can_create_repository": {
+ "type": "boolean",
+ "x-go-name": "CanCreateRepository"
+ },
+ "can_read": {
+ "type": "boolean",
+ "x-go-name": "CanRead"
+ },
+ "can_write": {
+ "type": "boolean",
+ "x-go-name": "CanWrite"
+ },
+ "is_admin": {
+ "type": "boolean",
+ "x-go-name": "IsAdmin"
+ },
+ "is_owner": {
+ "type": "boolean",
+ "x-go-name": "IsOwner"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"PRBranchInfo": {
"description": "PRBranchInfo information about a branch",
"type": "object",
@@ -17742,6 +17808,12 @@
}
}
},
+ "OrganizationPermissions": {
+ "description": "OrganizationPermissions",
+ "schema": {
+ "$ref": "#/definitions/OrganizationPermissions"
+ }
+ },
"PublicKey": {
"description": "PublicKey",
"schema": {