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

Disable SecurityManager voter for commands #33

Open
josecelano opened this issue Sep 16, 2014 · 0 comments
Open

Disable SecurityManager voter for commands #33

josecelano opened this issue Sep 16, 2014 · 0 comments

Comments

@josecelano
Copy link

I use isGranted method inside a Symfony command:

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        ...
        $this->getContainer()->get('security.context')->isGranted(...)
        ...
    }

and I get this error:

PHP Fatal error: Call to a member function get() on a non-object in ...\vendor\codeconsortium\ccdn-user-security-bundle\CCDNUser\SecurityBundle\Component\Authorisation\SecurityManager.php on line 101

It seems Synfony call your CCDNUser\SecurityBundle\Component\Authorisation\SecurityManager voter and there is no request as no HTTP request is being done.

How can I disable CCDNUserSecurityBundle with commands? if it´s not possible, is there a way to avoid this problem?

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

No branches or pull requests

1 participant