philiplb / CRUDlex

CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages
https://philiplb.de/crudlex/
MIT License
109 stars 23 forks source link

Question: Override configuration #81

Closed marcelloh closed 7 years ago

marcelloh commented 7 years ago

Would it be possible to override certain configurations in realtime, so I can have a list per user.

We have this: listFields: [id, created_at, updated_at, author, title] and it's the same for all users.

When I can override this, because a user is capable of having a personalized view, I could store it somewhere [author, title, id, created_at, updated_at] and restore it just before I show the list.

Or even make some fields hidden for this user: listFields: [id, author, title]

And some would like me to have a personalized pagesize as well.

philiplb commented 7 years ago

So user A gets a different listFields configuration than user B? As CRUDlex is itself is not tied to any security component, this is not currently possible. But what you could do is: Extend the ControllerProvider class and override the function showList. There, you could:

You then need to mount your extended controller instead of the standard one.

Feel free to reopen the issue if you have any more questions or feedback. :)

marcelloh commented 7 years ago

Yes; User A gets a different view.

Nice idea, perhaps with the stuff you giving me, I'm going to try some of it :-)