cesarMarcal

Untitled

Sep 4th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Seed de testes
  2.  
  3. -- Inserir permissões
  4. INSERT INTO public."Role"("name")
  5. VALUES
  6.   ('canCreateRole'),
  7.   ('canCreateUser'),
  8.   ('canCreateProfile'),
  9.   ('canUpdateProfile'),
  10.   ('canReadProfile'),
  11.   ('canDeleteProfile'),
  12.   ('canUpdateProfileRoles'),
  13.   ('canUpdateUser'),
  14.   ('canReadUser'),
  15.   ('canDeleteUser'),
  16.   ('canUpdateRole'),
  17.   ('canReadRole'),
  18.   ('canDeleteRole');
  19.  
  20. -- Inserir usuário Admin
  21. INSERT INTO public."Profile"("name")
  22.     VALUES('Admin');
  23.  
  24. -- Atribuir todas as permissões para o perfil criado anteriormente
  25. INSERT INTO public."_ProfileRoles"("roleId", "profileId")
  26.     SELECT id as roleId, 1 as profileId
  27.     FROM public."Role";
Add Comment
Please, Sign In to add comment