Add method to check organization membership (#1037)

* Add remote method to check organization membership
* Use named return parameters in interface
* Add membership check service
* Update Gitea SDK
This commit is contained in:
Lauris BH
2022-07-25 04:09:35 +03:00
committed by GitHub
parent 1e8d4cc455
commit 19dfc331f4
19 changed files with 342 additions and 14 deletions

View File

@@ -301,6 +301,13 @@ func (c *Coding) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model
return repo, build, err
}
// OrgMembership returns if user is member of organization and if user
// is admin/owner in this organization.
func (c *Coding) OrgMembership(ctx context.Context, u *model.User, owner string) (*model.OrgPerm, error) {
// TODO: Not supported in Coding OAuth API
return nil, nil
}
// helper function to return the Coding oauth2 context using an HTTPClient that
// disables TLS verification if disabled in the remote settings.
func (c *Coding) newContext(ctx context.Context) context.Context {