mock-permissions.ts 497 B

12345678910111213141516171819
  1. // Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. import { useSessionStore } from '@shared/stores/session'
  3. import { initializeStore } from './components/initializeStore'
  4. export const mockPermissions = (permissions: string[]) => {
  5. initializeStore()
  6. const session = useSessionStore()
  7. if (!session.user) {
  8. session.user = {
  9. id: '123',
  10. internalId: 1,
  11. objectAttributeValues: [],
  12. }
  13. }
  14. session.user!.permissions = { names: permissions }
  15. }