hackzilla-project / TicketBundle

Bundle provides multilingual ticketing functionality for Symfony applications.
http://hackzilla.org
MIT License
64 stars 43 forks source link

Allow custom permissions #235

Closed regisgrison closed 2 years ago

regisgrison commented 2 years ago

Hi,

I hope this change will be OK for you as it was really needed for me: I had to allow users to see tickets based on their group so I needed to add a custom way to show ticket list and to access ticket.

I just added a first check on user class method if it exists and fallback to the current way of validation if it does not (so it does not create a dependancy on this user class method).

I hope PR will work properly because github show me the previous version of your repository, not including the last PR you already accepted.

For now, it's all I have to send you ;)

Regards.

hackzilla commented 2 years ago

I'm certainly like the idea in principle, but not 100% convinced about the approach. Potentially custom permissions would be better as an injectable class.

regisgrison commented 2 years ago

I'm certainly like the idea in principle, but not 100% convinced about the approach. Potentially custom permissions would be better as an injectable class.

I first though about it because I saw you did it but I must admit I'm not very familiar with injectable class (and I must admit I needed a quick solution).

In fact, the 2 methods I added to my User class were very simple: adding some DQL to one and just a return with a comparison for the other and they were in the same class (for the same purpose).

If I want to use reflexion class, I would have to add one for each manager or do you think about another common class?