Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

529 B
Raw Blame
import { PermissionType } from './types'

type LegacyPluginPermissionAccessOptions = {
  isAdminOrOwner: boolean
  permission?: PermissionType
  rbacEnabled?: boolean
}

export const hasLegacyPluginPermissionAccess = ({
  isAdminOrOwner,
  permission,
  rbacEnabled,
}: LegacyPluginPermissionAccessOptions) => {
  if (rbacEnabled !== false) return true

  if (!permission) return false

  if (permission === PermissionType.everyone) return true

  if (permission === PermissionType.admin) return isAdminOrOwner

  return false
}