Handling own/other permissions for API v2#383
Conversation
…lugin would still work with stock M4
dongilbert
left a comment
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 { …}
}
}
|
@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. |
|
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 |
There was a problem hiding this comment.
@escopecz Thank You!
I have verified View Own, View Others, Delete / Edit Own, Create Own, Publish Own, Delete/Edit Other permissions for custom objects & custom object's items, Also verified APIs. It is working as expected.
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: