1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

feat: only admin can fetch license (#9697)

Non admins can not fetch the license they're still allowed to check it
but not to get it
This commit is contained in:
Gastón Fournier 2025-04-03 16:26:36 +02:00 committed by GitHub
parent 821851a2f3
commit 2748ced8e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,15 +1,11 @@
import { Banner } from 'component/banners/Banner/Banner';
import {
useLicense,
useLicenseCheck,
} from 'hooks/api/getters/useLicense/useLicense';
import { useLicenseCheck } from 'hooks/api/getters/useLicense/useLicense';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import type { BannerVariant } from 'interfaces/banner';
export const LicenseBanner = () => {
const { isEnterprise } = useUiConfig();
const licenseInfo = useLicenseCheck();
const license = useLicense();
// Only for enterprise
if (
@ -29,7 +25,7 @@ export const LicenseBanner = () => {
return <Banner key={banner.message} banner={banner} />;
} else {
if (!license.loading && !license.error && licenseInfo.message) {
if (licenseInfo.message) {
const banner = {
message: licenseInfo.message,
variant: mapToVariant(licenseInfo.messageType),