import { useCoreStore } from '@/stores'

/**
 * 权限状态检查
 */
export function permissionStatus(requiredLimit: string, permissionCode?: string): string {
  const coreStore = useCoreStore()
  const authorities = coreStore.userAuthority?.permissions || []

  const hasPermission = authorities.some(auth => auth.code === permissionCode)
  return hasPermission ? requiredLimit : ''
}
