Handling own/other permissions for API v2#383
Open
escopecz wants to merge 10 commits into
Open
Conversation
…lugin would still work with stock M4
dongilbert
reviewed
Jun 12, 2026
dongilbert
requested changes
Jun 22, 2026
dongilbert
left a comment
Member
There was a problem hiding this comment.
The build is failing with:
Error {#22199
#message: "Undefined constant Mautic\ApiBundle\ApiEvents::API_PLATFORM_PERMISSION_CONTEXT"
#code: 0
#file: "./plugins/CustomObjectsBundle/EventListener/ApiPlatformPermissionContextSubscriber.php"
#line: 17
trace: {
./plugins/CustomObjectsBundle/EventListener/ApiPlatformPermissionContextSubscriber.php:17 {
MauticPlugin\CustomObjectsBundle\EventListener\ApiPlatformPermissionContextSubscriber::getSubscribedEvents(): array
› return [
› ApiEvents::API_PLATFORM_PERMISSION_CONTEXT => ['onApiPlatformPermissionContext', 0],
› ];
}
./vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php:172 { …}
./vendor/symfony/event-dispatcher/EventDispatcher.php:197 { …}
./vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php:120 { …}
./vendor/symfony/dependency-injection/Compiler/Compiler.php:94 { …}
./vendor/symfony/dependency-injection/ContainerBuilder.php:762 { …}
./vendor/symfony/http-kernel/Kernel.php:594 { …}
./app/AppKernel.php:254 { …}
./vendor/symfony/framework-bundle/Console/Application.php:169 { …}
./vendor/symfony/framework-bundle/Console/Application.php:75 { …}
./vendor/symfony/console/Application.php:149 { …}
./bin/console:42 { …}
}
}
Contributor
Author
|
@dongilbert that happened after addressing your earlier comment. See #383 (comment) There are 2 options:
The CI in this repo runs agains stock Mautic, not ACS as it is open sourced. On the team sync call last week we decided to go with 2. But I'm fine with either. |
Contributor
Author
|
Oh, I just realized that we are testing against Mautic 4.4: https://github.com/acquia/mc-cs-plugin-custom-objects/blob/staging/.github/workflows/tests.yml#L23 So the new event won't ever show up there. I'll have to revert to make this plugin work for Mautic 4 |
dongilbert
approved these changes
Jun 23, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This is hooking into the latest security release of Mautic, backported to Campaign Studio. The Mautic version isn't handling the dynamically built permissions for this plugin. ACS had to add a new event so the CO plugin could hook into it and provide the permissions the core can work with.
Steps to test this PR: