FOF30\Platform\Joomla\Platform::authorise PHP Method

authorise() public method

Perform an ACL check.
See also: PlatformInterface::authorise()
public authorise ( string $action, string $assetname ) : boolean
$action string The ACL privilege to check, e.g. core.edit
$assetname string The asset name to check, typically the component's name
return boolean True if the user is allowed this action
    public function authorise($action, $assetname)
    {
        if ($this->isCli()) {
            return true;
        }
        return \JFactory::getUser()->authorise($action, $assetname);
    }

Usage Example

Example #1
0
 public function authorise($action, $assetname)
 {
     if (is_callable(static::$authorise)) {
         return call_user_func_array(static::$authorise, array($action, $assetname));
     }
     return parent::authorise($action, $assetname);
 }