1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/common/front-end-routing/routes/cluster/events/events-route.injectable.ts
Sebastian Malton 0ec8cbd7ed
Fix shouldShowResource when not a cluster admin (#6900)
* Fix shouldShowResource when not a cluster admin

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix only tests that rely on bad formatting of resources

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-01-11 09:02:10 -05:00

25 lines
752 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { shouldShowResourceInjectionToken } from "../../../../cluster-store/allowed-resources-injection-token";
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
const eventsRouteInjectable = getInjectable({
id: "events-route",
instantiate: (di) => ({
path: "/events",
clusterFrame: true,
isEnabled: di.inject(shouldShowResourceInjectionToken, {
apiName: "events",
group: "",
}),
}),
injectionToken: frontEndRouteInjectionToken,
});
export default eventsRouteInjectable;