How to get a form view name in Access controls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2013 07:10 AM
Hi Experts,
We have a customer requirement where List of records from one table should be displayed in 3 views.
Given each view with different filters and access, I have created 2 UI policies for views(say view A and view B).
For the 3rd view I need to glide the table to check for certain logic for which I have written a access control.
The problem I'm facing is, whenever the ACL is active the UI policies for the 2 views are not working, i.e. Access control is overriding it.
Please suggest how can I use the view names in access control to restrict or any best practice.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2013 07:29 AM
ACLs do win, as you've seen. And since they're enforced not just in form actions but also in lists and scripts, it doesn't really know the concept of form views.
One could probably do some hackery with trying to use the "RP" object to look for the form view (I think RP.getViewID() might return something), but the problem there is that RP might not exist for any given look at the ACL. It's there for form and list rendering, but isn't for any other action. So you'd need to do it in a try/catch block, which starts getting messy.
I dunno about *best* practice (don't like that phrase), but a good practice would be to use UI Policy which can be View-specific. If you're worried about list editing, put an ACL on that field where the Operation is "list_edit" to restrict who can do it.