ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

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

  • Creator
    Topic
  • #16841
    Ahmad Golzar
    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
  • #16867
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    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)

You must be logged in to reply to this topic.