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

Method HasAccess

internal/database/repo.go:605–612  ·  view source on GitHub ↗
(userID int64)

Source from the content-addressed store, hash-verified

603}
604
605func (r *Repository) HasAccess(userID int64) bool {
606 return Handle.Permissions().Authorize(context.TODO(), userID, r.ID, AccessModeRead,
607 AccessModeOptions{
608 OwnerID: r.OwnerID,
609 Private: r.IsPrivate,
610 },
611 )
612}
613
614func (r *Repository) IsOwnedBy(userID int64) bool {
615 return r.OwnerID == userID

Callers

nothing calls this directly

Implementers 2

Repositoryinternal/database/repo.go
mailerRepointernal/database/issue_mail.go

Calls 2

AuthorizeMethod · 0.80
PermissionsMethod · 0.80

Tested by

no test coverage detected