Detecting CLI sounds like a good way to do this.

Thanks!

On Sat, Nov 2, 2013 at 11:09 AM, Artur Bodera <abod...@gmail.com> wrote:

>
> On Fri, Nov 1, 2013 at 7:24 PM, Julian Vidal <jul...@julianvidal.com>wrote:
>
>> Is this the right way to approach this situation? Can anyone suggest a
>> better alternative?
>>
>
> Change the default role when in CLI environment.
>
> For example, using BjyAuthorize:
>
> // authenticate as admin in case we're running from CLI
> if(Console::isConsole()) {
>     /** @var AuthenticationIdentityProvider $identityProvider */
>     $identityProvider =
> $this->sm->get('BjyAuthorize\Provider\Identity\ProviderInterface');
>     $identityProvider->setDefaultRole('admin');
>     $identityProvider->setAuthenticatedRole('admin');
> }
>
>
> --
> abod...@gmail.com
> +48 695 600 936
> http://thinkscape.pro
>

Reply via email to