Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support re-enabling actions if they have been disabled. #6210

Open
wants to merge 3 commits into
base: 4.x
Choose a base branch
from

Conversation

dragosprotung
Copy link
Contributor

If an action has been disabled, there is no way to reenable it.

This is usefull when having a base controller that gets extended to create different views. If an action should by default be disabled (in the base controller) it will not be possible to reenable it in the extending controller.

Also fixes #5128

@@ -132,6 +132,13 @@ public function disable(string ...$disabledActionNames): self
return $this;
}

public function enable(string ...$enabledActionNames): self
{
$this->dto->enableActions($enabledActionNames);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also re enable Action::BATCH_DELETE in case Action::DELETE is enabled?
(to be consistent with the disable method)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I update the code to reflect this.
I also re-enable Action::DELETE if Action::BATCH_DELETE is re-enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-enable a disabled action
2 participants