Using role controls on DetailView and EditView custom buttons

bsoremsugar —  November 29, 2012 — 2 Comments

We had a good question come up on an earlier blog post on how to control the display of buttons on DetailViews and EditViews. Out of the box the buttons come with the normal ACL controls in place, but what if you are defining a custom button?

This is actually quite simple to do. You can call the $bean->aclAccess method in the Smarty template to check like follows…

This insures the ACL control is evaluated at runtime of the form and not the compile time of the template

2 responses to Using role controls on DetailView and EditView custom buttons

  1. 

    John, as an additional comment, I would suggest to add the same ACL check to the custom controller action the button is pointing at (or action file, if using the legacy mode), so that we make sure that the functionality itself obeys the role layer as well.

    Cheers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s