diff --git a/app/Http/Controllers/OvertimeTimesheetController.php b/app/Http/Controllers/OvertimeTimesheetController.php index bf5af6bc..8ee8ba6f 100644 --- a/app/Http/Controllers/OvertimeTimesheetController.php +++ b/app/Http/Controllers/OvertimeTimesheetController.php @@ -15,7 +15,7 @@ class OvertimeTimesheetController extends Controller { public function __invoke(?string $month = null): BinaryFileResponse { - $this->authorize("manageRequestsAsAdministrativeApprover"); + $this->authorize("downloadOvertimeSummary"); $month = Carbon::canBeCreatedFromFormat($month, "m-Y") ? Carbon::createFromFormat("d-m-Y", "01-$month") diff --git a/app/Http/Controllers/TimesheetController.php b/app/Http/Controllers/TimesheetController.php index c0c648db..c5fc4f18 100644 --- a/app/Http/Controllers/TimesheetController.php +++ b/app/Http/Controllers/TimesheetController.php @@ -17,7 +17,7 @@ class TimesheetController extends Controller { public function __invoke(VacationTypeConfigRetriever $configRetriever, ?string $month = null): BinaryFileResponse { - $this->authorize("manageRequestsAsAdministrativeApprover"); + $this->authorize("downloadWorkHoursSummary"); $month = Carbon::canBeCreatedFromFormat($month, "m-Y") ? Carbon::createFromFormat("d-m-Y", "01-$month") diff --git a/composer.lock b/composer.lock index 8c559bb6..42085c6f 100644 --- a/composer.lock +++ b/composer.lock @@ -816,30 +816,30 @@ }, { "name": "azuyalabs/yasumi", - "version": "2.7.0", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/azuyalabs/yasumi.git", - "reference": "37d1215d4f4012d3185bb9990c76ca17a4ff1c30" + "reference": "cc07874da062070fdc201a4297a7724f7d6aafb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/azuyalabs/yasumi/zipball/37d1215d4f4012d3185bb9990c76ca17a4ff1c30", - "reference": "37d1215d4f4012d3185bb9990c76ca17a4ff1c30", + "url": "https://api.github.com/repos/azuyalabs/yasumi/zipball/cc07874da062070fdc201a4297a7724f7d6aafb2", + "reference": "cc07874da062070fdc201a4297a7724f7d6aafb2", "shasum": "" }, "require": { "ext-json": "*", - "php": ">=8.0" + "php": ">=8.1" }, "require-dev": { + "azuyalabs/php-cs-fixer-config": "^0.3", "ext-intl": "*", - "friendsofphp/php-cs-fixer": "^2.19 || ^3.40", "mikey179/vfsstream": "^1.6", - "phan/phan": "^5.4", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-deprecation-rules": "^2.0", "phpunit/phpunit": "^8.5 || ^9.6", - "vimeo/psalm": "^5.16" + "vimeo/psalm": "^6.12" }, "suggest": { "ext-calendar": "For calculating the date of Easter" @@ -858,10 +858,11 @@ { "name": "Sacha Telgenhof", "email": "me@sachatelgenhof.com", + "homepage": "https://www.sachatelgenhof.com", "role": "Maintainer" } ], - "description": "The easy PHP Library for calculating holidays.", + "description": "The easy PHP Library for calculating holidays", "homepage": "https://www.yasumi.dev", "keywords": [ "Bank", @@ -885,7 +886,7 @@ "type": "other" } ], - "time": "2024-01-07T14:12:44+00:00" + "time": "2025-07-13T15:40:05+00:00" }, { "name": "barryvdh/laravel-dompdf", diff --git a/config/permission.php b/config/permission.php index 93a159ea..4fad8cc0 100644 --- a/config/permission.php +++ b/config/permission.php @@ -64,6 +64,8 @@ "receiveBenefitsReportCreationNotification", "manageEquipment", "receiveOvertimeRequestsSummaryNotification", + "downloadWorkHoursSummary", + "downloadOvertimeSummary", ], "permission_roles" => [ Role::Administrator->value => [ @@ -90,6 +92,8 @@ "receiveVacationRequestStatusChangedNotification", "manageEquipment", "receiveOvertimeRequestsSummaryNotification", + "downloadWorkHoursSummary", + "downloadOvertimeSummary", ], Role::AdministrativeApprover->value => [ "managePermissions", @@ -114,6 +118,8 @@ "receiveVacationRequestStatusChangedNotification", "receiveBenefitsReportCreationNotification", "manageEquipment", + "downloadWorkHoursSummary", + "downloadOvertimeSummary", ], Role::TechnicalApprover->value => [ "manageTechnologies", diff --git a/resources/js/Composables/permissionInfo.js b/resources/js/Composables/permissionInfo.js index 73f12b19..048b3965 100644 --- a/resources/js/Composables/permissionInfo.js +++ b/resources/js/Composables/permissionInfo.js @@ -84,6 +84,11 @@ const permissionsInfo = [ 'value': 'skipRequestFlow', 'section': 'Urlopy', }, + { + 'name': 'Pobieranie podsumowania godzin pracy', + 'value': 'downloadWorkHoursSummary', + 'section': 'Urlopy', + }, { 'name': 'Zarządzanie wnioskami jako przełożony administracyjny', 'value': 'manageOvertimeAsAdministrativeApprover', @@ -99,6 +104,11 @@ const permissionsInfo = [ 'value': 'listAllOvertimeRequests', 'section': 'Nadgodziny', }, + { + 'name': 'Pobieranie podsumowania nadgodzin', + 'value': 'downloadOvertimeSummary', + 'section': 'Nadgodziny', + }, { 'name': 'Nadchodzące i zaległe badania medycyny pracy', 'value': 'receiveUpcomingAndOverdueMedicalExamsNotification', diff --git a/resources/js/Pages/Calendar.vue b/resources/js/Pages/Calendar.vue index a3ff3b90..86b8ee55 100644 --- a/resources/js/Pages/Calendar.vue +++ b/resources/js/Pages/Calendar.vue @@ -144,14 +144,14 @@ function resetSettings() { - Pobierz plik Excel + Pobierz podsumowanie godzin diff --git a/resources/js/Pages/OvertimeRequest/ApproversIndex.vue b/resources/js/Pages/OvertimeRequest/ApproversIndex.vue index a29f9965..f555b324 100644 --- a/resources/js/Pages/OvertimeRequest/ApproversIndex.vue +++ b/resources/js/Pages/OvertimeRequest/ApproversIndex.vue @@ -78,14 +78,14 @@ watch(form, debounce(() => {
- Pobierz plik Excel + Pobierz nadgodziny
diff --git a/tests/Feature/PermissionTest.php b/tests/Feature/PermissionTest.php index 86aaf7fd..518bcc93 100644 --- a/tests/Feature/PermissionTest.php +++ b/tests/Feature/PermissionTest.php @@ -52,7 +52,9 @@ public function testAdminCanSeeEditEmployeePermissionsForm(): void ->where("receiveVacationRequestWaitsForApprovalNotification", false) ->where("receiveVacationRequestStatusChangedNotification", false) ->where("manageEquipment", false) - ->where("receiveOvertimeRequestsSummaryNotification", false), + ->where("receiveOvertimeRequestsSummaryNotification", false) + ->where("downloadWorkHoursSummary", false) + ->where("downloadOvertimeSummary", false), ), ); } @@ -96,7 +98,9 @@ public function testAdminCanSeeEditTechnicalApproverPermissionsForm(): void ->where("receiveVacationRequestWaitsForApprovalNotification", true) ->where("receiveVacationRequestStatusChangedNotification", true) ->where("manageEquipment", false) - ->where("receiveOvertimeRequestsSummaryNotification", true), + ->where("receiveOvertimeRequestsSummaryNotification", true) + ->where("downloadWorkHoursSummary", false) + ->where("downloadOvertimeSummary", false), ), ); } @@ -140,7 +144,9 @@ public function testAdminCanSeeEditAdministrativeApproverPermissionsForm(): void ->where("receiveVacationRequestWaitsForApprovalNotification", true) ->where("receiveVacationRequestStatusChangedNotification", true) ->where("manageEquipment", true) - ->where("receiveOvertimeRequestsSummaryNotification", false), + ->where("receiveOvertimeRequestsSummaryNotification", false) + ->where("downloadWorkHoursSummary", true) + ->where("downloadOvertimeSummary", true), ), ); }