Forums OroCRM OroCRM – Programming Questions How to find list of all users who has access to an object

This topic contains 1 reply, has 2 voices, and was last updated by  Yevhen Shyshkin 1 year, 10 months ago.

  • Creator
  • #22522

    Ahmad Golzar


    We need to find list of all users who has “VIEW” access to a specific “contact” (or any other entity object). How can we do that?

    Is there a method like this:
    getUsers(‘VIEW’, $myEntity);


Viewing 1 replies (of 1 total)
  • Author
  • #22523

    Yevhen Shyshkin


    Right now there is no such method because security requires quite complex logic to calculate this list, so performance will be an issue too.

    If you have some specific cases then I’d recommend to handle them separately – e.g. if you know that VIEW permissions might be accessible only for users with specific role you can select users that have this specific role.

    But if you still want to have such list then you should calculate it in advance in some kind of cache table (e.g. you can create cron command for that) – in this command you should emulate logging of all users in your system, save list of allowed entities (you can use regular query builder with applied AclHelper) and then use this list to render list of users.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.