Add index to system management
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import React from 'react'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import { hasPathPermission, hasPermission } from '@/util/auth'
|
||||
|
||||
interface PermissionProps extends React.PropsWithChildren {
|
||||
operationCode?: string
|
||||
path?: string
|
||||
}
|
||||
|
||||
const Permission: React.FC<PermissionProps> = (props) => {
|
||||
if (!props.operationCode || hasPermission(props.operationCode)) {
|
||||
if (
|
||||
(!props.operationCode || hasPermission(props.operationCode)) &&
|
||||
(!props.path || hasPathPermission(props.path))
|
||||
) {
|
||||
return props.children
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user