Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / sql / Pg-upgrade2-auth / rights_time_recording_show_edit_all.sql
diff --git a/sql/Pg-upgrade2-auth/rights_time_recording_show_edit_all.sql b/sql/Pg-upgrade2-auth/rights_time_recording_show_edit_all.sql
new file mode 100644 (file)
index 0000000..24453a9
--- /dev/null
@@ -0,0 +1,27 @@
+-- @tag: rights_time_recording_show_edit_all
+-- @description: Rechte, Zeiterfassungseinträge aller Mitarbeiter anzuzeigen bzw. zu bearbeiten
+-- @depends: right_time_recording
+-- @locales: List time recordings of all staff members
+-- @locales: Edit time recordings of all staff members
+
+INSERT INTO auth.master_rights (position, name, description, category)
+  VALUES ((SELECT position + 20 FROM auth.master_rights WHERE name = 'time_recording'),
+          'time_recording_show_all',
+          'List time recordings of all staff members',
+          FALSE);
+
+INSERT INTO auth.group_rights (group_id, "right", granted)
+  SELECT id, 'time_recording_show_all', true
+  FROM auth.group
+  WHERE name = 'Vollzugriff';
+
+INSERT INTO auth.master_rights (position, name, description, category)
+  VALUES ((SELECT position + 20 FROM auth.master_rights WHERE name = 'time_recording_show_all'),
+          'time_recording_edit_all',
+          'Edit time recordings of all staff members',
+          FALSE);
+
+INSERT INTO auth.group_rights (group_id, "right", granted)
+  SELECT id, 'time_recording_edit_all', true
+  FROM auth.group
+  WHERE name = 'Vollzugriff';