From c87080d8d84989ee40c6ae64151bdf23b629afc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 30 Nov 2020 12:59:29 +0100 Subject: [PATCH] =?utf8?q?Zeiterfassung:=20Ein=20Recht=20daf=C3=BCr?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/TimeRecording.pm | 6 +++++- menus/user/10-time-recording.yaml | 3 +++ sql/Pg-upgrade2-auth/right_time_recording.sql | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 sql/Pg-upgrade2-auth/right_time_recording.sql diff --git a/SL/Controller/TimeRecording.pm b/SL/Controller/TimeRecording.pm index 95de51388..c0a4cdc0c 100644 --- a/SL/Controller/TimeRecording.pm +++ b/SL/Controller/TimeRecording.pm @@ -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) = @_; diff --git a/menus/user/10-time-recording.yaml b/menus/user/10-time-recording.yaml index 0e42a4f36..59817a021 100644 --- a/menus/user/10-time-recording.yaml +++ b/menus/user/10-time-recording.yaml @@ -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 @@ -10,11 +11,13 @@ 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 index 000000000..dbd0f3251 --- /dev/null +++ b/sql/Pg-upgrade2-auth/right_time_recording.sql @@ -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); -- 2.20.1