diff --git a/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala index 46bbeebf6f..74721aafbf 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala @@ -57,12 +57,16 @@ class OrganisationCtrl @Inject() ( def get(organisationId: String): Action[AnyContent] = entrypoint("get organisation") .authRoTransaction(db) { implicit request => implicit graph => - userSrv - .current - .organisations - .visibleOrganisationsFrom - .get(organisationId) - .getOrFail() + (if (request.organisation == "admin") + organisationSrv.get(organisationId) + else + userSrv + .current + .organisations + .visibleOrganisationsFrom + .get(organisationId)) + .richOrganisation + .getOrFail("Organisation") .map(organisation => Results.Ok(organisation.toJson)) }