Zeiterfassung: Ein Recht dafür
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 30 Nov 2020 11:59:29 +0000 (12:59 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 5 May 2021 15:25:02 +0000 (17:25 +0200)
SL/Controller/TimeRecording.pm
menus/user/10-time-recording.yaml
sql/Pg-upgrade2-auth/right_time_recording.sql [new file with mode: 0644]

index 95de513..c0a4cdc 100644 (file)
@@ -23,7 +23,7 @@ use Rose::Object::MakeMethods::Generic
 
 
 # safety
-#__PACKAGE__->run_before('check_auth');
+__PACKAGE__->run_before('check_auth');
 
 #
 # actions
@@ -138,6 +138,10 @@ sub init_all_employees {
   SL::DB::Manager::Employee->get_all_sorted;
 }
 
+sub check_auth {
+  $::auth->assert('time_recording');
+}
+
 sub prepare_report {
   my ($self) = @_;
 
index 0e42a4f..59817a0 100644 (file)
@@ -3,6 +3,7 @@
   id: system_time_recording_types
   name: Time Recording Types
   order: 2370
+  access: config
   params:
     action: SimpleSystemSetting/list
     type: time_recording_type
   id: productivity_time_recording
   name: Time Recording
   order: 350
+  access: time_recording
   params:
     action: TimeRecording/edit
 - parent: productivity_reports
   id: productivity_reports_time_recording
   name: Time Recording
   order: 300
+  access: time_recording
   params:
     action: TimeRecording/list
diff --git a/sql/Pg-upgrade2-auth/right_time_recording.sql b/sql/Pg-upgrade2-auth/right_time_recording.sql
new file mode 100644 (file)
index 0000000..dbd0f32
--- /dev/null
@@ -0,0 +1,10 @@
+-- @tag: right_time_recording
+-- @description: Recht zur Zeiterfassung
+-- @depends: release_3_5_6_1
+-- @locales: Create, edit and list time recordings
+
+INSERT INTO auth.master_rights (position, name, description, category)
+  VALUES ((SELECT position + 10 FROM auth.master_rights WHERE name = 'productivity'),
+          'time_recording',
+          'Create, edit and list time recordings',
+          FALSE);