Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stripe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
Stripe
Commits
c540659b
Commit
c540659b
authored
2 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Fix public access to processPublic API
parent
0d4cf3c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!209
6.8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Civi/Api4/StripePaymentintent.php
+1
-4
1 addition, 4 deletions
Civi/Api4/StripePaymentintent.php
stripe.php
+0
-15
0 additions, 15 deletions
stripe.php
with
1 addition
and
19 deletions
Civi/Api4/StripePaymentintent.php
+
1
−
4
View file @
c540659b
...
...
@@ -13,10 +13,7 @@ class StripePaymentintent extends Generic\DAOEntity {
public
static
function
permissions
()
{
$permissions
=
parent
::
permissions
();
$permissions
[
'processMOTO'
]
=
[
'allow stripe moto payments'
];
// The "minimum" permission for an API4 call is "access CiviCRM"|"access AJAX API".
// We can't remove the requirement for one of those permissions here.
// So we specify only 'make online contributions' using alterAPIRoutePermissions hook.
// $permissions['processPublic'] = ['make online contributions'];
$permissions
[
'processPublic'
]
=
[
'make online contributions'
];
return
$permissions
;
}
...
...
This diff is collapsed.
Click to expand it.
stripe.php
+
0
−
15
View file @
c540659b
...
...
@@ -255,18 +255,3 @@ function stripe_civicrm_permission(&$permissions) {
$permissions
[
'allow stripe moto payments'
]
=
E
::
ts
(
'CiviCRM Stripe: Process MOTO transactions'
);
}
}
/**
* Implements hook_civicrm_alterApiRoutePermissions().
*
* @see CRM_Utils_Hook::alterApiRoutePermissions
*/
function
stripe_civicrm_alterApiRoutePermissions
(
&
$permissions
,
$entity
,
$action
)
{
if
(
$entity
==
'StripePaymentintent'
)
{
// These actions should be accessible to anonymous users; permissions are checked internally
$allowedActions
=
[
'ProcessPublic'
];
if
(
in_array
(
$action
,
$allowedActions
,
TRUE
))
{
$permissions
=
'make online contributions'
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment