MCPcopy Create free account
hub / github.com/gogs/gogs / IsOrganizationOwner

Function IsOrganizationOwner

internal/database/org.go:253–256  ·  view source on GitHub ↗

IsOrganizationOwner returns true if given user is in the owner team.

(orgID, userID int64)

Source from the content-addressed store, hash-verified

251
252// IsOrganizationOwner returns true if given user is in the owner team.
253func IsOrganizationOwner(orgID, userID int64) bool {
254 has, _ := x.Where("is_owner = ?", true).And("uid = ?", userID).And("org_id = ?", orgID).Get(new(OrgUser))
255 return has
256}
257
258// IsOrganizationMember returns true if given user is member of organization.
259func IsOrganizationMember(orgID, uid int64) bool {

Callers 3

IsOwnedByMethod · 0.85
RemoveOrgUserFunction · 0.85
IsUserOrgOwnerMethod · 0.85

Calls 2

WhereMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected