OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums 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 8 years ago.

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

  • Creator
    Topic
  • #25142

    Ahmad Golzar
    Participant

    Hi,

    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);

    Thanks

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #25143

    Yevhen Shyshkin
    Participant

    Hello.

    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)

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

Back to top