-
-
Notifications
You must be signed in to change notification settings - Fork 14
Additional service options #54
Comments
👍 dunglas_action:
must_be_public:
- Symfony\Component\Security\Core\Authorization\Voter\VoterInterface and make all the others private (or maybe also add an option for that)? IMO every service should be able to be private but it was refused in the core. |
Why not using a user-land compiler pass for that? You can do a simple check on the namespace. |
@dunglas that's indeed already possible but it complexify the installation of the bundle. |
👍 private by default and public by option sounds good. |
👎 for private services by default, I would rather just follow the Symfony convention here. As services are not private by default (although there is an issue to change that, symfony/symfony#20048), I don't think it should be done here. Instead of just having dunglas_action:
services:
'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface':
tags: [ name: 'mytag' ]
public: false EDIT: actually isn't it already doable by overriding the service definition? services:
'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface':
tags: [ name: 'mytag' ]
public: false |
I have created a CompilerPass for another "service option" that resolves a "problem" with the "autotag" feature: if you need to set a priority for a service, then you can't use autotag. I have implemented an interface That way I can use autotag and priority. If you think this is of interest for this bundle, I can make a PR |
I want to also add
public: false
property to all Voters.I have the following entry:
I would not like to define all the Voter services, just because I want them all to be private.
Do you think a config key for options (excluding autowire) would be a good solution for this?
The text was updated successfully, but these errors were encountered: