Skip to content

Commit

Permalink
Auto blacklist disabled actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Dec 19, 2022
1 parent c9c21a4 commit ba6053f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,10 @@ protected function _getAllowedActions(): array
$blacklist = (array)$this->_action()->getConfig('scaffold.actions_blacklist');
$blacklist = array_combine($blacklist, $blacklist);
foreach ($this->_crud()->getConfig('actions') as $action => $config) {
if ($config['className'] === 'Crud.Lookup') {
if (
$config['className'] === 'Crud.Lookup' ||
!$this->_controller()->Crud->action($action)->enabled()
) {
$blacklist[$action] = $action;
}
}
Expand Down

0 comments on commit ba6053f

Please sign in to comment.