Added option to pass user object to getActions helper method.

This commit is contained in:
2019-09-02 10:27:11 +02:00
parent 0b95737524
commit 9781910dd3
9 changed files with 46 additions and 26 deletions

View File

@ -6022,14 +6022,19 @@ abstract class ComponentbuilderHelper
* @param string $views The related list view name
* @param mixed $target Only get this permission (like edit, create, delete)
* @param string $component The target component
* @param object $user The user whose permissions we are loading
*
* @return object The JObject of permission/authorised actions
*
**/
public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder')
public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder', $user = 'null')
{
// get the user object
$user = JFactory::getUser();
// load the user if not given
if (!self::checkObject($user))
{
// get the user object
$user = JFactory::getUser();
}
// load the JObject
$result = new JObject;
// make view name safe (just incase)