aboutsummaryrefslogtreecommitdiffstats
path: root/modules
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 /modules
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 'modules')
-rw-r--r--modules/structs/org.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/structs/org.go b/modules/structs/org.go
index 38c6c6d6d8..4ae0ca8b6f 100644
--- a/modules/structs/org.go
+++ b/modules/structs/org.go
@@ -17,6 +17,15 @@ type Organization struct {
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
}
+// OrganizationPermissions list differents users permissions on an organization
+type OrganizationPermissions struct {
+ IsOwner bool `json:"is_owner"`
+ IsAdmin bool `json:"is_admin"`
+ CanWrite bool `json:"can_write"`
+ CanRead bool `json:"can_read"`
+ CanCreateRepository bool `json:"can_create_repository"`
+}
+
// CreateOrgOption options for creating an organization
type CreateOrgOption struct {
// required: true