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:
parent
821851a2f3
commit
2748ced8e2
@ -1,15 +1,11 @@
|
|||||||
import { Banner } from 'component/banners/Banner/Banner';
|
import { Banner } from 'component/banners/Banner/Banner';
|
||||||
import {
|
import { useLicenseCheck } from 'hooks/api/getters/useLicense/useLicense';
|
||||||
useLicense,
|
|
||||||
useLicenseCheck,
|
|
||||||
} from 'hooks/api/getters/useLicense/useLicense';
|
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import type { BannerVariant } from 'interfaces/banner';
|
import type { BannerVariant } from 'interfaces/banner';
|
||||||
|
|
||||||
export const LicenseBanner = () => {
|
export const LicenseBanner = () => {
|
||||||
const { isEnterprise } = useUiConfig();
|
const { isEnterprise } = useUiConfig();
|
||||||
const licenseInfo = useLicenseCheck();
|
const licenseInfo = useLicenseCheck();
|
||||||
const license = useLicense();
|
|
||||||
|
|
||||||
// Only for enterprise
|
// Only for enterprise
|
||||||
if (
|
if (
|
||||||
@ -29,7 +25,7 @@ export const LicenseBanner = () => {
|
|||||||
|
|
||||||
return <Banner key={banner.message} banner={banner} />;
|
return <Banner key={banner.message} banner={banner} />;
|
||||||
} else {
|
} else {
|
||||||
if (!license.loading && !license.error && licenseInfo.message) {
|
if (licenseInfo.message) {
|
||||||
const banner = {
|
const banner = {
|
||||||
message: licenseInfo.message,
|
message: licenseInfo.message,
|
||||||
variant: mapToVariant(licenseInfo.messageType),
|
variant: mapToVariant(licenseInfo.messageType),
|
||||||
|
Loading…
Reference in New Issue
Block a user