Skip to content

Commit

Permalink
refactor(pr): pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ale8k committed Dec 13, 2024
1 parent b9b0f3a commit ade1505
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/jimm/jimm.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ type API interface {
// can list models for any user (at this stage). Other users
// can only ask about their own models.
//
// In our wrapper, we ask for the owner. So expect ALL models from
// In our wrapper, we ask as the controller admin. So expect ALL models from
// the controller.
ListModels(ctx context.Context) ([]base.UserModel, error)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/jimm/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -1358,13 +1358,13 @@ func (j *JIMM) ListModels(ctx context.Context, user *openfga.User) ([]base.UserM
const op = errors.Op("jimm.ListModels")
zapctx.Info(ctx, string(op))

// Get models uuids user has access to
// Get uuids of models the user has access to
uuids, err := user.ListModels(ctx, ofganames.ReaderRelation)
if err != nil {
return nil, errors.E(op, err, "failed to list models")
return nil, errors.E(op, err, "failed to list user models")
}

// Get the models themselves
// Get the models from the database
models, err := j.DB().GetModelsByUUID(ctx, uuids)
if err != nil {
return nil, errors.E(op, err, "failed to get models by uuid")
Expand Down
2 changes: 1 addition & 1 deletion internal/jujuclient/modelmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (c Connection) ChangeModelCredential(ctx context.Context, model names.Model
// can list models for any user (at this stage). Other users
// can only ask about their own models.
//
// In our wrapper, we ask for the owner. So expect ALL models from
// In our wrapper, we ask as the controller admin. So expect ALL models from
// the controller.
func (c Connection) ListModels(ctx context.Context) ([]base.UserModel, error) {
return modelmanager.NewClient(&c).ListModels("admin")
Expand Down

0 comments on commit ade1505

Please sign in to comment.