Skip to content

Commit

Permalink
chore: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ale8k committed Dec 13, 2024
1 parent 0141ef3 commit 2ad39e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 1 addition & 5 deletions internal/jimm/jimm.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,7 @@ type API interface {
// ListStorageDetails lists all storage.
ListStorageDetails(ctx context.Context) ([]jujuparams.StorageDetails, error)

// ListModels returns UserModel's for the user that is logged in. If the user logged
// in is "admin" they may specify another user's models.
//
// In our wrapper, we ask as the controller admin. So expect ALL models from
// the controller.
// ListModels returns all UserModel's on the controller.
ListModels(ctx context.Context) ([]base.UserModel, error)
}

Expand Down
7 changes: 4 additions & 3 deletions internal/jimm/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,9 +1399,10 @@ func (j *JIMM) ListModels(ctx context.Context, user *openfga.User) ([]base.UserM
// Filter the models returned according to the uuids
// returned from OpenFGA for read access.
//
// NOTE: We skip controller models as ListModels is used for login and register.
// The models returned are stored locally and used for reference. In the case of JIMM,
// we do not want to show the controller models.
// NOTE: The controller models are skipped because we do not relate users
// to controller models, we skip the controller models as ListModels is used for
// login and register - the models returned are stored locally and used for reference.
// In the case of JIMM, we do not want to show the controller models.
for _, um := range ums {
// Filter models that match authorised uuids list
if slices.Contains(uuids, um.UUID) {
Expand Down

0 comments on commit 2ad39e0

Please sign in to comment.