MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / isUserOrgAdmin

Function isUserOrgAdmin

app/controlplane/internal/service/service.go:365–368  ·  view source on GitHub ↗

isUserOrgAdmin checks if the current user is an org admin or owner

(ctx context.Context)

Source from the content-addressed store, hash-verified

363
364// isUserOrgAdmin checks if the current user is an org admin or owner
365func isUserOrgAdmin(ctx context.Context) bool {
366 userRole := usercontext.CurrentAuthzSubject(ctx)
367 return authz.Role(userRole).IsAdmin()
368}
369
370// initializePaginationOpts initializes the pagination options with the provided request pagination options.
371func initializePaginationOpts(reqPagination *pb.OffsetPaginationRequest) (*pagination.OffsetPaginationOpts, error) {

Callers 3

CreateMethod · 0.85
FindOrCreateWorkflowMethod · 0.85

Calls 3

CurrentAuthzSubjectFunction · 0.92
RoleTypeAlias · 0.92
IsAdminMethod · 0.80

Tested by

no test coverage detected