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 {
|
||||
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),
|
||||
|
Loading…
Reference in New Issue
Block a user