diff --git a/internal/jimm/jimm.go b/internal/jimm/jimm.go index 75cfa2abf..fdadd7977 100644 --- a/internal/jimm/jimm.go +++ b/internal/jimm/jimm.go @@ -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) } diff --git a/internal/jimm/model.go b/internal/jimm/model.go index 21cb7204c..e706c6f99 100644 --- a/internal/jimm/model.go +++ b/internal/jimm/model.go @@ -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) {