OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions How to filter the datagrid based on the ACL

This topic contains 2 replies, has 2 voices, and was last updated by  Bernhard Kau 5 years, 1 month ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #33906

    Bernhard Kau

    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:

    So 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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #33907

    Vova Soroka

    Hello Bernhard!

    One of solutions is to use query hints. Please look at

    Here is an example


    Bernhard Kau

    Hey thanks for your reply Vova! That still would require a developer not to forget to add the “hints”, but it’s still a pretty neat functionality as the WHERE will be more complex as the application get’s more functionailty and you than only have to update the hint. Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No