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.

758 B
Raw Blame
'use client'

import type { AccessPolicyResourceType } from '@/models/access-control'
import PermissionGroupList from '../../permission-group-list'
import { usePermissionsGroups } from './hooks'

type PermissionPickerProps = {
  resourceType: AccessPolicyResourceType
  value: string[]
  onChange: (next: string[]) => void
  className?: string
  readonly?: boolean
}

const PermissionPicker = ({
  resourceType,
  value,
  onChange,
  className,
  readonly = false,
}: PermissionPickerProps) => {
  const { groups } = usePermissionsGroups(resourceType)

  return (
    <PermissionGroupList
      groups={groups}
      value={value}
      onChange={onChange}
      className={className}
      readonly={readonly}
    />
  )
}

export default PermissionPicker