_request = & $request; // Make sure a single operation doesn't have to // be passed in as an array. assert(is_string($operations) || is_array($operations)); if (!is_array($operations)) { $operations = [$operations]; } $this->_operations = $operations; } // // Setters and Getters // /** * Return the request. * * @return \PKP\core\PKPRequest */ public function &getRequest() { return $this->_request; } /** * Return the operations whitelist. * * @return array */ public function getOperations() { return $this->_operations; } // // Private helper methods // /** * Check whether the requested operation is on * the list of permitted operations. * * @return bool */ public function _checkOperationWhitelist() { // Only permit if the requested operation has been whitelisted. $router = $this->_request->getRouter(); $requestedOperation = $router->getRequestedOp($this->_request); assert(!empty($requestedOperation)); return in_array($requestedOperation, $this->_operations); } } if (!PKP_STRICT_MODE) { class_alias('\PKP\security\authorization\HandlerOperationPolicy', '\HandlerOperationPolicy'); }