civicrm/civicrm-core — pull request #670 by pratik-joshi (2013-05-07 13:29:07+00:00)
Title: CRM-12503

Why this issue raised:
1) During navigation building : permission check of each menu item takes place, also along with that component name is fetched with the help of permission of menu item, and that component name is used for checking weather the component is enabled or disabled.

2) Component name is evaluated with the help of menu item permission by using CRM_Core_Permission::getComponentName function:
- while 'Mailings' menu item check, the permissions for it like 'create mailings,approve mailings,schedule mailings' return NULL as component name instead of returning 'CiviMail', thus the component active check is skipped and the menu item is displayed.

The fix:
- inside the CRM_Core_Permission::getComponentName($permission), to get component permissions CRM_{componentName}_Info::getPermissions is used.

Introducing a new '$getAllUnconditionally' argument and handling this argument inside in CRM_{componentName}_Info::getPermissions makes it possible to return 'all' (including conditional) permissions.