完成JC-ArtList与JC-Salon端侧清理和统一命名
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Purpose: SHOPLESS_ADMIN_ALLOWED_PREFIXES supports platform-admin-permissions.ts by holding or executing the shopless admin allowed prefixes page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const SHOPLESS_ADMIN_ALLOWED_PREFIXES = ['user:', 'shop:', 'permission:', 'message:', 'announcement:']
|
||||
/**
|
||||
* Purpose: SHOPLESS_ADMIN_ALLOWED_PERMISSIONS supports platform-admin-permissions.ts by holding or executing the shopless admin allowed permissions page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const SHOPLESS_ADMIN_ALLOWED_PERMISSIONS = [
|
||||
'messagehub:config:manage',
|
||||
'security:audit:view',
|
||||
'legal_agreement:manage'
|
||||
]
|
||||
|
||||
/**
|
||||
* Purpose: isAllowedForShoplessPlatformAdmin supports platform-admin-permissions.ts by holding or executing the is allowed for shopless platform admin page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
export const isAllowedForShoplessPlatformAdmin = (permissionCode: string) =>
|
||||
permissionCode === 'dashboard:view'
|
||||
|| permissionCode.endsWith(':view')
|
||||
|| SHOPLESS_ADMIN_ALLOWED_PERMISSIONS.includes(permissionCode)
|
||||
|| SHOPLESS_ADMIN_ALLOWED_PREFIXES.some(prefix => permissionCode.startsWith(prefix))
|
||||
Reference in New Issue
Block a user