From: Bernd Bleßmann Date: Mon, 30 Nov 2020 11:59:29 +0000 (+0100) Subject: Zeiterfassung: Ein Recht dafür X-Git-Tag: kivitendo-mebil_0.1-0~9^2~339 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c87080d8d84989ee40c6ae64151bdf23b629afc1;p=kivitendo-erp.git Zeiterfassung: Ein Recht dafür --- 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);