From b52b5673884122819ee56b4ef0be318c4f77ddf4 Mon Sep 17 00:00:00 2001 From: Mekan1206 Date: Sat, 15 Aug 2026 14:53:51 +0500 Subject: [PATCH] Enhance user role checks to include 'direktor' permissions across various components, including product relations, global order resource actions, and authentication gates. --- .cursor/debug-6d4d12.log | 120 ++++++++++++++++++ .../Product/UpdateProductRelations.php | 2 +- .../Nova/Resources/GlobalOrderResource.php | 15 ++- app/Providers/AuthServiceProvider.php | 4 +- .../Product/NovaProductRepository.php | 2 +- 5 files changed, 135 insertions(+), 8 deletions(-) create mode 100644 .cursor/debug-6d4d12.log diff --git a/.cursor/debug-6d4d12.log b/.cursor/debug-6d4d12.log new file mode 100644 index 0000000..3b3d557 --- /dev/null +++ b/.cursor/debug-6d4d12.log @@ -0,0 +1,120 @@ +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787409331} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787409345} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787409359} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787409383} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787409876} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787410135} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787427933} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787427948} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787427962} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787427986} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787428559} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787428567} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787428648} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787428807} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787428816} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787430199} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787430216} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787430231} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787430257} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787430885} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787430886} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787430887} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787431281} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787433339} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787433353} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787433367} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787433390} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787433700} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787433701} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787433706} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787433919} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787433919} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787433920} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787434027} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787434028} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787434030} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787434113} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787434114} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787434115} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787435476} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787435490} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787435504} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787435530} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787436164} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787436174} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787436249} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787437352} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787437369} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787437387} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787437416} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787437872} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787437875} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787438082} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787438083} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787438099} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787438099} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787438726} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787438741} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787438755} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787438781} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787439399} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787439569} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787439845} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787439863} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787439879} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787439912} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787440502} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H1","location":"AuthServiceProvider.php:systemUser","message":"systemUser gate evaluated","data":{"userId":3,"roles":["direktor"],"systemUser":true,"isDirektor":true},"timestamp":1786787440509} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787440597} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787450327} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787450341} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787450355} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787450379} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787450876} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787451037} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787451580} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787451602} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787451620} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787451653} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787452006} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H3","location":"NovaProductRepository.php:inventoryDependsOn","message":"inventory options branch","data":{"userId":3,"isAdmin":false,"isDirektor":true,"isEntrepreneur":false,"optionsFilled":true},"timestamp":1786787452010} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787452204} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H3","location":"NovaProductRepository.php:inventoryDependsOn","message":"inventory options branch","data":{"userId":3,"isAdmin":false,"isDirektor":true,"isEntrepreneur":false,"optionsFilled":true},"timestamp":1786787452212} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787458722} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787458776} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787467374} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787467586} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787467746} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787505406} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H3","location":"NovaProductRepository.php:inventoryDependsOn","message":"inventory options branch","data":{"userId":3,"isAdmin":false,"isDirektor":true,"isEntrepreneur":false,"optionsFilled":true},"timestamp":1786787505412} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787505437} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H3","location":"NovaProductRepository.php:inventoryDependsOn","message":"inventory options branch","data":{"userId":3,"isAdmin":false,"isDirektor":true,"isEntrepreneur":false,"optionsFilled":true},"timestamp":1786787505442} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787523788} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H3","location":"NovaProductRepository.php:inventoryDependsOn","message":"inventory options branch","data":{"userId":3,"isAdmin":false,"isDirektor":true,"isEntrepreneur":false,"optionsFilled":true},"timestamp":1786787523794} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787523816} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H3","location":"NovaProductRepository.php:inventoryDependsOn","message":"inventory options branch","data":{"userId":3,"isAdmin":false,"isDirektor":true,"isEntrepreneur":false,"optionsFilled":true},"timestamp":1786787523820} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787524867} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787524883} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787524899} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787524926} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525229} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525252} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525278} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525337} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525390} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525410} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525426} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787525448} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787525603} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787525604} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548796} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548814} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548833} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548861} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548887} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548904} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548918} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"GlobalOrderResource.php:authorizedToViewAny","message":"global orders viewAny","data":{"userId":3,"isAdmin":false,"isDirektor":true,"allowed":true},"timestamp":1786787548941} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787549709} +{"sessionId":"6d4d12","runId":"post-fix","hypothesisId":"H2","location":"AuthServiceProvider.php:isAdmin","message":"isAdmin gate evaluated","data":{"userId":3,"roles":["direktor"],"isAdmin":false,"isDirektor":true,"gateAllowed":true},"timestamp":1786787549709} diff --git a/app/Jobs/Ecommerce/Product/UpdateProductRelations.php b/app/Jobs/Ecommerce/Product/UpdateProductRelations.php index 535b592..19609bb 100644 --- a/app/Jobs/Ecommerce/Product/UpdateProductRelations.php +++ b/app/Jobs/Ecommerce/Product/UpdateProductRelations.php @@ -40,7 +40,7 @@ class UpdateProductRelations implements ShouldQueue $this->model->collections()->sync($this->collections); $this->model->inventories()->sync($this->inventories); - if ($this->user->isAdmin()) { + if ($this->user->isAdmin() || $this->user->isDirektor()) { $this->model->channels()->sync($this->channel); } diff --git a/app/Modules/GlobalOrder/Nova/Resources/GlobalOrderResource.php b/app/Modules/GlobalOrder/Nova/Resources/GlobalOrderResource.php index f4ca7fb..cd606f0 100644 --- a/app/Modules/GlobalOrder/Nova/Resources/GlobalOrderResource.php +++ b/app/Modules/GlobalOrder/Nova/Resources/GlobalOrderResource.php @@ -165,7 +165,9 @@ class GlobalOrderResource extends Resource */ public static function authorizedToViewAny(Request $request) { - return auth()->user() && auth()->user()->isAdmin(); + $user = auth()->user(); + + return $user && ($user->isAdmin() || $user->isDirektor()); } /** @@ -175,8 +177,9 @@ class GlobalOrderResource extends Resource */ public function authorizedToView(Request $request) { + $user = auth()->user(); - return auth()->user() && auth()->user()->isAdmin(); + return $user && ($user->isAdmin() || $user->isDirektor()); } /** @@ -186,7 +189,9 @@ class GlobalOrderResource extends Resource */ public static function authorizedToCreate(Request $request) { - return auth()->user() && auth()->user()->isAdmin(); + $user = auth()->user(); + + return $user && ($user->isAdmin() || $user->isDirektor()); } /** @@ -194,7 +199,9 @@ class GlobalOrderResource extends Resource */ public function authorizedToUpdate(Request $request): bool { - return auth()->user() && auth()->user()->isAdmin(); + $user = auth()->user(); + + return $user && ($user->isAdmin() || $user->isDirektor()); } /** diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 4aacee2..cf854ae 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -141,8 +141,8 @@ class AuthServiceProvider extends ServiceProvider public function boot(): void { Gate::define('isMe', fn ($user) => $user->isMe()); - Gate::define('isAdmin', fn ($user) => $user->isAdmin()); - Gate::define('systemUser', fn ($user) => $user->isMe() || $user->hasRole(['admin', 'manager'])); + Gate::define('isAdmin', fn ($user) => $user->isAdmin() || $user->isDirektor()); + Gate::define('systemUser', fn ($user) => $user->isMe() || $user->hasRole(['admin', 'manager', 'direktor'])); Gate::define('vendor', fn ($user) => $user->hasRole('vendor')); Gate::define('isVendor', fn ($user) => $user->hasRole('vendor')); } diff --git a/app/Repositories/Ecommerce/Product/NovaProductRepository.php b/app/Repositories/Ecommerce/Product/NovaProductRepository.php index 5f4b01a..0ea00d8 100644 --- a/app/Repositories/Ecommerce/Product/NovaProductRepository.php +++ b/app/Repositories/Ecommerce/Product/NovaProductRepository.php @@ -29,7 +29,7 @@ class NovaProductRepository })->pluck('name', 'id')); } - if ($user->isAdmin()) { + if ($user->isAdmin() || $user->isDirektor()) { $field->options(Inventory::pluck('name', 'id')); } };