import {hasPermission} from '@/utils/permission/index'
import {PermissionConst, RoleConst} from '@/utils/permission/data'

const systemManage = {
  create: () => false,
  batchDelete: () => false,
  batchMove: () => false,
    folderCreate: () => false,
    edit: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_EDIT
            ],
            'OR'
    ),
    folderEdit: () => false,
    folderRead: () => false,
    folderManage: () => false,
    folderAuth: () => false,
    export: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_EXPORT
            ],
            'OR'
    ),
    delete: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_DELETE
            ],
            'OR'
    ),
    trigger_read: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_TRIGGER_READ
            ],
            'OR'
    ),
    trigger_create: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_TRIGGER_CREATE
            ],
            'OR'
    ),
    trigger_edit: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_TRIGGER_EDIT
            ],
            'OR'
    ),
    trigger_delete: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_TRIGGER_DELETE
            ],
            'OR'
    ),
    debug: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_EDIT
            ],
            'OR'
    ),
    folderDelete: () => false,
    auth: () => 
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_AUTH
            ],
            'OR'
    ),
    overview_embed: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_OVERVIEW_EMBED
            ],
            'OR'
    ),
    overview_access: () =>
      hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_OVERVIEW_ACCESS
            ],
            'OR'
    ),
    overview_display: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_OVERVIEW_DISPLAY
            ],
            'OR'
    ),
    overview_api_key: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_OVERVIEW_API_KEY
            ],
            'OR'
    ),
    access_edit: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_ACCESS_EDIT
            ],
            'OR'
    ),
    application_chat_user_edit: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_CHAT_USER_EDIT
            ],
            'OR'
    ),
    chat_log_clear: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_CHAT_LOG_CLEAR_POLICY
            ],
            'OR'
    ),
    chat_log_export: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_CHAT_LOG_EXPORT
            ],
            'OR'
    ),
    chat_log_add_knowledge: () =>
        hasPermission(
            [
              RoleConst.ADMIN,
              PermissionConst.RESOURCE_APPLICATION_CHAT_LOG_ADD_KNOWLEDGE
            ],
            'OR'
    ),
    overview_read: () => 
      hasPermission(
        [
          RoleConst.ADMIN,
          PermissionConst.RESOURCE_APPLICATION_OVERVIEW_READ
        ],
        'OR'
    ),
    jump_read: () => 
      hasPermission(
        [
          RoleConst.ADMIN,
          PermissionConst.RESOURCE_APPLICATION_OVERVIEW_READ,
          PermissionConst.RESOURCE_APPLICATION_READ,
        ],
        'OR'
    ),  
    access_read: () => 
      hasPermission(
        [
          RoleConst.ADMIN,
          PermissionConst.RESOURCE_APPLICATION_ACCESS_READ
        ],'OR'    
    ),
    chat_user_read: () => 
      hasPermission(
        [
          RoleConst.ADMIN,
          PermissionConst.RESOURCE_APPLICATION_CHAT_USER_READ
        ],'OR'
    ),
    chat_user_edit: () =>false,

    chat_log_read: () => 
      hasPermission(
        [
          RoleConst.ADMIN,
          PermissionConst.RESOURCE_APPLICATION_CHAT_LOG_READ
        ],
        'OR')
}
export default systemManage
