dify/web/models/permission.ts
YungLe 219596c4df
feat(plugin-auth): visibility picker for OAuth credentials (#39840)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Wu Tianwei <30284043+WTW0313@users.noreply.github.com>
Co-authored-by: twwu <twwu@dify.ai>
2026-08-17 02:41:26 +00:00

20 lines
626 B
TypeScript

/**
* Shared permission levels for resources (datasets, credentials, etc.).
* Mirrors PermissionEnum from api/models/enums.py.
*/
export const PermissionLevel = {
onlyMe: 'only_me',
allTeamMembers: 'all_team_members',
partialMembers: 'partial_members',
} as const
export type PermissionLevel = (typeof PermissionLevel)[keyof typeof PermissionLevel]
/**
* Subset of PermissionLevel accepted for plugin credentials — partial_members
* is not supported for OAuth/API-key credentials on the backend.
*/
export type CredentialPermission =
| typeof PermissionLevel.onlyMe
| typeof PermissionLevel.allTeamMembers