mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: authentication configuration permission (#8987)
New permission for SSO config.
This commit is contained in:
		
							parent
							
								
									138ba35d7a
								
							
						
					
					
						commit
						9b15343a79
					
				| @ -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={ | ||||||
|  | |||||||
| @ -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 | ||||||
|  | |||||||
| @ -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
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user