UpdateAccess updates the access restriction for a user
(ctx context.Context, userID uuid.UUID, isAccessRestricted bool)
| 111 | |
| 112 | // UpdateAccess updates the access restriction for a user |
| 113 | func (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 |
| 126 | func (r *userRepo) FindAll(ctx context.Context, pagination *pagination.OffsetPaginationOpts) ([]*biz.User, int, error) { |
nothing calls this directly
no test coverage detected