-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
use Civi\API\Event\AuthorizeEvent; | ||
|
||
class CRM_eWAYRecurring_APIWrapper { | ||
|
||
/** | ||
* React to authorization requests to allow overriding permissions on API calls | ||
*/ | ||
public static function authorize(AuthorizeEvent $event) { | ||
$callback = [ self::class, 'authorize_' . $event->getEntityName() ]; | ||
|
||
if (is_callable($callback)) { | ||
call_user_func($callback, $event); | ||
} | ||
} | ||
|
||
|
||
protected static function authorize_PaymentToken(AuthorizeEvent $event) { | ||
$requiredPermission = ($event->getActionName() == 'get') ? 'view payment tokens' : 'edit payment tokens'; | ||
|
||
if ( | ||
CRM_Core_Permission::check('access CiviContribute', $event->getUserID()) | ||
|| CRM_Core_Permission::check($requiredPermission, $event->getUserID()) | ||
) { | ||
$event->authorize(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ | |
<email>[email protected]</email> | ||
</maintainer> | ||
<develStage>stable</develStage> | ||
<releaseDate>2023-01-27</releaseDate> | ||
<version>2.4.4</version> | ||
<releaseDate>2023-05-19</releaseDate> | ||
<version>2.5.0</version> | ||
<compatibility> | ||
<ver>5.38</ver> | ||
</compatibility> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters