CoreSphere/ConsoleBundle

Black/White-listing some commands

Opened this issue · 0 comments

I was thinking it would be a nice addition, for example when you're using this bundle to allow your client to handle simple tasks in production (custom symfony commands) but does not want to let him a chance to drop the database entirely (for example).

It could be implemented with new configuration keys like :

coresphere_console:
    filtering:
       whitelist: [ 'client-friendly-namespace:*', 'cache:clear', 'assetic:dump', 'assets:install' ]

or

coresphere_console:
    filtering:
       blacklist: [ 'doctrine:*', 'generate:*', 'config:dump-reference' ]

It would probably need to support * syntax (or it would become a mess) and handle conflicts between the two configuration (white/black). Seldaek's MonologBundle use a clean syntax for the channels selection, might be worth to get some inspiration from there.

I would be willing to take some time to implement it. What do you think ?