From d0a681fbc3fb626adcddbbb13f8c96c0bbd72c02 Mon Sep 17 00:00:00 2001 From: Romain Date: Tue, 12 Oct 2021 12:47:19 +0200 Subject: [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> --- modules/structs/org.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules') 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 -- cgit v1.2.3