src/wcmf/lib/security/impl/DefaultPermissionManager.php
protected function getPermissionInstance($resource, $context, $action) {
    $query = new ObjectQuery($this->permissionType, __CLASS__.__METHOD__);
    $tpl = $query->getObjectTemplate($this->permissionType);
    $tpl->setValue('resource', Criteria::asValue('=', $resource));
    $tpl->setValue('context', Criteria::asValue('=', $context));
    $tpl->setValue('action', Criteria::asValue('=', $action));
    $permissions = $query->execute(BuildDepth::SINGLE);
    return (sizeof($permissions) > 0) ? $permissions[0] : null;
  }
protected function getPermissionInstance($resource, $context, $action) {
    $query = new ObjectQuery($this->permissionType, __CLASS__.__METHOD__);
    $tpl = $query->getObjectTemplate($this->permissionType);
    $tpl->setValue('resource', Criteria::asValue('=', $resource));
    $tpl->setValue('context', Criteria::asValue('=', $context));
    $tpl->setValue('action', Criteria::asValue('=', $action));
    $permissions = $query->execute(BuildDepth::SINGLE);
    return (sizeof($permissions) > 0) ? $permissions[0] : null;
  }
protected function getPermissionInstance ( $ resource , $ context , $ action ) { $ query = new ObjectQuery ( $ this -> permissionType , __CLASS__ . __METHOD__ ) ; $ tpl = $ query -> getObjectTemplate ( $ this -> permissionType ) ; $ tpl -> setValue ( 'resource' , Criteria :: asValue ( '=' , $ resource ) ) ; $ tpl -> setValue ( 'context' , Criteria :: asValue ( '=' , $ context ) ) ; $ tpl -> setValue ( 'action' , Criteria :: asValue ( '=' , $ action ) ) ; $ permissions = $ query -> execute ( BuildDepth :: SINGLE ) ; return ( sizeof ( $ permissions ) > 0 ) ? $ permissions [ 0 ] : null ; }
Get the permission object that matches the given parameters
@param $resource Resource
@param $context Context
@param $action Action
@return Instance of _permissionType or null
Get the permission object that matches the given parameters