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

Function IsCollaborator

internal/database/repo_collaboration.go:32–43  ·  view source on GitHub ↗

IsCollaborator returns true if the user is a collaborator of the repository.

(repoID, userID int64)

Source from the content-addressed store, hash-verified

30
31// IsCollaborator returns true if the user is a collaborator of the repository.
32func IsCollaborator(repoID, userID int64) bool {
33 collaboration := &Collaboration{
34 RepoID: repoID,
35 UserID: userID,
36 }
37 has, err := x.Get(collaboration)
38 if err != nil {
39 log.Error("get collaboration [repo_id: %d, user_id: %d]: %v", repoID, userID, err)
40 return false
41 }
42 return has
43}
44
45func (r *Repository) IsCollaborator(userID int64) bool {
46 return IsCollaborator(r.ID, userID)

Callers 2

IsCollaboratorMethod · 0.70
DeleteCollaborationFunction · 0.70

Calls 2

GetMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected