hide Subpanel create button when user not having create/edit privilege

This commit is contained in:
p.kumar 2021-08-20 00:45:24 +05:30 committed by Dillon-Brown
parent 23781b36a6
commit 0669235df7

View file

@ -28,6 +28,7 @@
namespace App\ViewDefinitions\LegacyHandler;
use ACLController;
use App\Engine\LegacyHandler\LegacyHandler;
use App\Engine\LegacyHandler\LegacyScopeState;
use App\FieldDefinitions\Service\FieldDefinitionsProviderInterface;
@ -296,7 +297,8 @@ class SubPanelDefinitionHandler extends LegacyHandler implements SubPanelDefinit
continue;
}
if (strpos($top_button['widget_class'], 'Create') !== false) {
if (strpos($top_button['widget_class'], 'Create') !== false
&& ACLController::checkAccess($tab['module'], 'edit', true, 'module', true)) {
$topButtons[] = [
'key' => 'create',
'labelKey' => 'LBL_QUICK_CREATE',