Skip to content

Disable SecurityManager voter for commands #33

Description

@josecelano

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions