Пример #1
0
 /**
  * Method to check CUser object authorisation against an access control
  *
  * @param	string	$action		The name of the action to check for permission.
  * @param	string	$assetname	The name of the asset on which to perform the action.
  *
  * @return	boolean	True if authorised
  * @since	Jomsocial 2.4
  */
 public function authorise($action, $assetname = null, $assetObject = null)
 {
     // Check is similar call has been made before.
     if (is_string($assetname) && isset($_cacheAction[$action . $assetname])) {
         return $_cacheAction[$action . $assetname];
     }
     $access = CAccess::check($this->_userid, $action, $assetname, $assetObject);
     $_cacheAction[$action . $assetname] = $access;
     // If asset not found , get Joomla authorise.
     if ($access === null && method_exists('Juser', 'authorise')) {
         return parent::authorise($action, $assetname);
     }
     return $access;
 }