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

Method Authorize

internal/database/permissions.go:107–109  ·  view source on GitHub ↗

Authorize returns true if the user has as good as desired access mode to the repository.

(ctx context.Context, userID, repoID int64, desired AccessMode, opts AccessModeOptions)

Source from the content-addressed store, hash-verified

105// Authorize returns true if the user has as good as desired access mode to the
106// repository.
107func (s *PermissionsStore) Authorize(ctx context.Context, userID, repoID int64, desired AccessMode, opts AccessModeOptions) bool {
108 return desired <= s.AccessMode(ctx, userID, repoID, opts)
109}
110
111// SetRepoPerms does a full update to which users have which level of access to
112// given repository. Keys of the "accessMap" are user IDs.

Callers 9

UpdateOrgProtectBranchFunction · 0.80
permsAuthorizeFunction · 0.80
GetAssigneeByIDMethod · 0.80
HasAccessMethod · 0.80
DeleteDeployKeyFunction · 0.80
HTTPContexterFunction · 0.80
ParseCompareInfoFunction · 0.80
viewIssueFunction · 0.80

Calls 1

AccessModeMethod · 0.95

Tested by 1

permsAuthorizeFunction · 0.64