joomla/joomla-cms — pull request #2728 by sanderpotjer (2013-12-24 14:57:44+00:00)
Title: JHelperContent::getActions() function improvements

Summary
------------
This pull request improves the JHelperContent::getActions() and removes duplicate code from components using their own helper file for checking the available ACL actions.

Background
------------
Originally I started to look into the bug reported in #32956 of JoomlaCode (http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32956&start=0). In that bug report the Save buttons in the toolbar are not visible when a user should be able to see them. This issue is related to pull request: https://github.com/joomla/joomla-cms/pull/2049 where part of the Joomla getActions helpers per component are replaced by a general getActions helper.

The concept is nice, but results in several issues in Joomla 3.2 like buttons/parts not visible when a user should allow to see it.

Improvements
------------
In this pull request I propose a change of the JHelperContent::getActions() function in libraries/cms/helper/content.php. Main improvements:
- [x] JHelperContent::getActions it is more flexible for implementation by 3rd part extension with their own ACL section names in the access.xml files of components, no longer limited to the structure of com_content
- [x] JHelperContent::getActions checks for all available actions for a component (all available ACL actions from a component should be listed in the "component" section of the access.xml file), not just the ones available for the specific section. This prevents issues in views where general component actions are used as well.

With the improvements made in the JHelperContent::getActions helper I could further implement this in Joomla:
- [x] replaced the left over extensions using their own getActions helper with the general JHelperContent::getActions helper
- [x] removed the getActions function from the component helper files
- [x] corrected the already implemented JHelperContent::getActions with the correct variables
- [x] reduced number of action checks in several components
- [x] removed unused getActions calls

Testing
------------
Please apply this patch and test if:
a) reported Joomla 3.2 ACL issues are solved
b) configure permissions for user groups with specific access/actions allowed is working as expected.

Thanks for testing & checking! Sander