3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
12 namespace Civi\API\Event
;
15 * Class AuthorizeEvent
16 * @package Civi\API\Event
18 * Determine whether the API request is allowed for the current user.
19 * For successful execution, at least one listener must invoke
20 * $event->authorize().
22 * Event name: 'civi.api.authorize'
24 class AuthorizeEvent
extends Event
{
28 private $authorized = FALSE;
31 * Mark the request as authorized.
33 public function authorize() {
34 $this->authorized
= TRUE;
39 * TRUE if the request has been authorized.
41 public function isAuthorized() {
42 return $this->authorized
;