user-permissions.ts 727 B

12345678910111213141516171819202122
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. /* eslint-disable zammad/zammad-detect-translatable-string */
  3. import { useAppName } from '#shared/composables/useAppName.ts'
  4. import type { FieldResolverModule } from '#shared/entities/object-attributes/types/resolver.ts'
  5. import FieldResolver from '../FieldResolver.ts'
  6. export class FieldResolverUserPermissions extends FieldResolver {
  7. // NB: The user permissions field is currently supported only in desktop app.
  8. fieldType = useAppName() === 'desktop' ? 'toggleList' : 'hidden'
  9. public fieldTypeAttributes() {
  10. return {}
  11. }
  12. }
  13. export default <FieldResolverModule>{
  14. type: 'user_permission',
  15. resolver: FieldResolverUserPermissions,
  16. }