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

Re-enable a disabled action #5128

Open
bastien70 opened this issue Mar 18, 2022 · 1 comment · May be fixed by #6210
Open

Re-enable a disabled action #5128

bastien70 opened this issue Mar 18, 2022 · 1 comment · May be fixed by #6210

Comments

@bastien70
Copy link
Contributor

Describe the bug
If we disable some actions by default in the DashboardController, we can't re-enable these in child controller.

To Reproduce

DashboardController.php

    public function configureActions(): Actions
    {
        return parent::configureActions()
            ->disable(
                Action::EDIT,
                Action::NEW,
            )
    }

In other controller :

    public function configureActions(Actions $actions): Actions
    {
        return parent::configureActions($actions)
            ->add(Crud::PAGE_INDEX, Action::NEW);
    }

It says that it already exists, so we have to use update() method, but how can we re-enable the action with this method ?

@dwd-akira
Copy link
Contributor

dwd-akira commented Mar 18, 2022

Perhaps you can re-enable in $actions before configureActions.

But for me, you should configure actions and permissions in each controllers and don't use disable method in Dashboard if you want to re-enable it after.

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 a pull request may close this issue.

2 participants