diff options
author | Romain <romdum@users.noreply.github.com> | 2021-10-12 12:47:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 12:47:19 +0200 |
commit | d0a681fbc3fb626adcddbbb13f8c96c0bbd72c02 (patch) | |
tree | ed807f45d54993e20f63af81d9d964ddc2f258fe /modules | |
parent | 7b8723158e2a50834617f47b07c29f5436fede6d (diff) | |
download | gitea-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.go | 9 |
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 |