How is everyone handling record security, when requirements require dynamic visi

How is everyone handling record security, when requirements require dynamic visibility? For instance, we require records for an application to be visible for all application administrators and also to the process initiator (initiator should only see the record for the process isntance they have initiated). Sometimes, company divisional views are necessary as well - divisional administrators should only see records for their specific division. With nearly 40 applications in production, we do not want to have 3+ records for each application. Just wondering if anyone has experience with similar situations. Thanks!

OriginalPostID-155229

OriginalPostID-155229

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I may have forgotten about that constraint. However I think the solution I have in mind might still work. First, set the record field to "Id" (or whatever the primary key is, for example), and the operator to "In". For the expression (which I recommend eventually migrating off to a separate expression rule), you can still refer to =loggedInUser(). So within the expression, first have it checked whether loggedInUser is a system administrator; if so, do a quick Query Entity and pass back a list of all record IDs. If not, query for record IDs where the stored "initiator" = loggedinuser(), and pass those back. In both cases I believe the record listing will then only show the entries applicable for that user. Also I *think* this query would only be done once upon loading of the list, so it hopefully shouldn't cause much performance impact.
Reply
  • 0
    Certified Lead Developer
    I may have forgotten about that constraint. However I think the solution I have in mind might still work. First, set the record field to "Id" (or whatever the primary key is, for example), and the operator to "In". For the expression (which I recommend eventually migrating off to a separate expression rule), you can still refer to =loggedInUser(). So within the expression, first have it checked whether loggedInUser is a system administrator; if so, do a quick Query Entity and pass back a list of all record IDs. If not, query for record IDs where the stored "initiator" = loggedinuser(), and pass those back. In both cases I believe the record listing will then only show the entries applicable for that user. Also I *think* this query would only be done once upon loading of the list, so it hopefully shouldn't cause much performance impact.
Children
No Data