This topic contains 2 replies, has 2 voices, and was last updated by Bernhard Kau 8 years, 8 months ago.
- Topic
I am just started using the OroPlatform (and Symfony in general) and right now most things I can figure out. But one thing I don’t like with the datagrids. When you want to filter out all entity item, that do not belong to the current user, you have to do something like this in the “datagrid.yml” file:
123456789101112131415161718datagrid:notes-grid:source:acl_resource: acme.demo_viewtype: ormquery:select:- n.id- n.title- n.message- n.createdAtfrom:- { table: ACMEDemoBundle:demo, alias: n }where:and:- n.owner = @oro_security.security_facade->getLoggedUserIdSo the filter to hide entity items, that should not be shown do any user, you have to make sure to filter your datagrid accordingly. I also added an additional datagrid for a dashboard widget, where I had to add the exact same “where” clause.
My question is: Can I filter the entity item somewhere more central, so that a developer cannot accidentally forget the filter, when he creates a datagrid (or any other view, that queries entity item). I haven’t used entity repositories, providers or things like that. Would it be possible to filter the items in such classes?
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.