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

Method UpdateAccess

app/controlplane/pkg/data/user.go:113–123  ·  view source on GitHub ↗

UpdateAccess updates the access restriction for a user

(ctx context.Context, userID uuid.UUID, isAccessRestricted bool)

Source from the content-addressed store, hash-verified

111
112// UpdateAccess updates the access restriction for a user
113func (r *userRepo) UpdateAccess(ctx context.Context, userID uuid.UUID, isAccessRestricted bool) (*biz.User, error) {
114 ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.UpdateAccess")
115 defer span.End()
116
117 u, err := r.data.DB.User.UpdateOneID(userID).SetHasRestrictedAccess(isAccessRestricted).SetUpdatedAt(time.Now()).Save(ctx)
118 if err != nil {
119 return nil, fmt.Errorf("error updating user access: %w", err)
120 }
121
122 return entUserToBizUser(u), nil
123}
124
125// FindAll get all users in the system using pagination
126func (r *userRepo) FindAll(ctx context.Context, pagination *pagination.OffsetPaginationOpts) ([]*biz.User, int, error) {

Callers

nothing calls this directly

Calls 6

StartFunction · 0.92
entUserToBizUserFunction · 0.85
SaveMethod · 0.65
SetUpdatedAtMethod · 0.45
UpdateOneIDMethod · 0.45

Tested by

no test coverage detected