1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

feat: authentication configuration permission (#8987)

New permission for SSO config.
This commit is contained in:
Tymoteusz Czech 2024-12-17 10:16:24 +01:00 committed by GitHub
parent 138ba35d7a
commit 9b15343a79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import { ScimSettings } from './ScimSettings/ScimSettings';
import { PasswordAuth } from './PasswordAuth/PasswordAuth'; import { PasswordAuth } from './PasswordAuth/PasswordAuth';
import { GoogleAuth } from './GoogleAuth/GoogleAuth'; import { GoogleAuth } from './GoogleAuth/GoogleAuth';
import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard';
import { ADMIN } from '@server/types/permissions'; import { ADMIN, UPDATE_AUTH_CONFIGURATION } from '@server/types/permissions';
import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature'; import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature';
import { useState } from 'react'; import { useState } from 'react';
import { TabPanel } from 'component/common/TabNav/TabPanel/TabPanel'; import { TabPanel } from 'component/common/TabNav/TabPanel/TabPanel';
@ -51,7 +51,7 @@ export const AuthSettings = () => {
return ( return (
<div> <div>
<PermissionGuard permissions={ADMIN}> <PermissionGuard permissions={[ADMIN, UPDATE_AUTH_CONFIGURATION]}>
<PageContent <PageContent
withTabs withTabs
header={ header={

View File

@ -91,7 +91,8 @@ export const RolePermissionCategories = ({
.filter( .filter(
({ label }) => ({ label }) =>
granularAdminPermissionsEnabled || granularAdminPermissionsEnabled ||
label !== 'Instance maintenance', (label !== 'Instance maintenance' &&
label !== 'Authentication'),
) )
.map(({ label, type, permissions }) => ( .map(({ label, type, permissions }) => (
<RolePermissionCategory <RolePermissionCategory

View File

@ -43,6 +43,7 @@ export const DELETE_TAG_TYPE = 'DELETE_TAG_TYPE';
export const UPDATE_MAINTENANCE_MODE = 'UPDATE_MAINTENANCE_MODE'; export const UPDATE_MAINTENANCE_MODE = 'UPDATE_MAINTENANCE_MODE';
export const UPDATE_INSTANCE_BANNERS = 'UPDATE_INSTANCE_BANNERS'; export const UPDATE_INSTANCE_BANNERS = 'UPDATE_INSTANCE_BANNERS';
export const UPDATE_AUTH_CONFIGURATION = 'UPDATE_AUTH_CONFIGURATION';
// Project // Project
export const CREATE_FEATURE = 'CREATE_FEATURE'; export const CREATE_FEATURE = 'CREATE_FEATURE';
@ -148,6 +149,10 @@ export const ROOT_PERMISSION_CATEGORIES = [
label: 'Instance maintenance', label: 'Instance maintenance',
permissions: [UPDATE_MAINTENANCE_MODE, UPDATE_INSTANCE_BANNERS], permissions: [UPDATE_MAINTENANCE_MODE, UPDATE_INSTANCE_BANNERS],
}, },
{
label: 'Authentication',
permissions: [UPDATE_AUTH_CONFIGURATION],
},
]; ];
// Used on Frontend, to allow admin panel use for users with custom root roles // Used on Frontend, to allow admin panel use for users with custom root roles