Hey Flarum Folks (and @Kyrne ),
Just wondering if you can help, as I seem to be running into the same issue as therealsujitk , where I am able to create drafts and post them, but they do not disappear, and I can't delete them...
I get a
"You don't have permission to do that"
error.
Here is what appears in my debug view:
POST https://subdomain.domain.TLD/api/drafts/1
{
"errors": [
{
"status": "403",
"code": "permission_denied",
"detail": "Flarum\\User\\Exception\\PermissionDeniedException in /home/~/public_html/~/vendor/fof/drafts/src/Command/DeleteDraftHandler.php:36\nStack trace:\n#0 /home/~/public_html/~/vendor/illuminate/bus/Dispatcher.php(90): FoF\\Drafts\\Command\\DeleteDraftHandler->handle(Object(FoF\\Drafts\\Command\\DeleteDraft))\n#1 /home/~/public_html/~/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(FoF\\Drafts\\Command\\DeleteDraft))\n#2 /home/~/public_html/~/vendor/illuminate/pipeline/Pipeline.php(104): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(FoF\\Drafts\\Command\\DeleteDraft))\n#3 /home/~/public_html/~/vendor/illuminate/bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n#4 /home/~/public_html/~/vendor/illuminate/bus/Dispatcher.php(76): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(FoF\\Drafts\\Command\\DeleteDraft))\n#5 /home/~/public_html/~/vendor/fof/drafts/src/Api/Controller/DeleteDraftController.php(42): Illuminate\\Bus\\Dispatcher->dispatch(Object(FoF\\Drafts\\Command\\DeleteDraft))\n#6 /home/~/public_html/~/vendor/flarum/core/src/Api/Controller/AbstractDeleteController.php(24): FoF\\Drafts\\Api\\Controller\\DeleteDraftController->delete(Object(Laminas\\Diactoros\\ServerRequest))\n#7 /home/~/public_html/~/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flarum\\Api\\Controller\\AbstractDeleteController->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#8 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(65): Flarum\\Http\\RouteHandlerFactory->Flarum\\Http\\{closure}(Object(Laminas\\Diactoros\\ServerRequest), Array)\n#9 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\DispatchRoute->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Closure))\n#10 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#11 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\SetLocale->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#12 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(31): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#13 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\CheckCsrfToken->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#14 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(55): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#15 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\AuthenticateWithHeader->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#16 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#17 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\AuthenticateWithSession->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#18 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(51): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#19 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\RememberFromCookie->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#20 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#21 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\StartSession->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#22 /home/~/public_html/~/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#23 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Api\\Middleware\\FakeHttpMethods->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#24 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#25 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\ParseJsonBody->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#26 /home/~/public_html/~/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#27 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\HandleErrors->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#28 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#29 /home/~/public_html/~/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\\Stratigility\\MiddlewarePipe->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#30 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\RequestHandler->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#31 /home/~/public_html/~/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#32 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\BasePathRouter->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#33 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(42): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#34 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\\Stratigility\\Middleware\\OriginalMessages->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#35 /home/~/public_html/~/vendor/middlewares/base-path/src/BasePath.php(53): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#36 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\BasePath->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#37 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#38 /home/~/public_html/~/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\\Stratigility\\MiddlewarePipe->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\EmptyPipelineHandler))\n#39 /home/~/public_html/~/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\\Stratigility\\MiddlewarePipe->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#40 /home/~/public_html/~/vendor/flarum/core/src/Http/Server.php(42): Laminas\\HttpHandlerRunner\\RequestHandlerRunner->run()\n#41 /home/~/public_html/~/index.php(22): Flarum\\Http\\Server->listen()\n#42 {main}"
}
]
}