Fix: Proper Controller extension and test route
- Fixed AdminController to extend OCP\AppFramework\Controller - Annotations (@NoAdminRequired, @NoCSRFRequired) now work - Proper parent::__construct() call - Added test route /admin/test for debugging - Returns JSON to confirm controller works - Helps diagnose routing vs permission issues - Simplified routes to essential ones only - admin#index and admin#test This should resolve 'Access forbidden' for system admin users. The key fix was extending the proper Controller base class.
This commit is contained in:
@@ -4,12 +4,22 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\AnalyticsHub;
|
||||
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
|
||||
/**
|
||||
* Routes for Mini-CMO Analytics Hub
|
||||
*/
|
||||
|
||||
return [
|
||||
'routes' => [
|
||||
// Test route
|
||||
[
|
||||
'name' => 'admin#test',
|
||||
'url' => '/test',
|
||||
'verb' => 'GET',
|
||||
'requirements' => [],
|
||||
],
|
||||
// Admin routes
|
||||
[
|
||||
'name' => 'admin#index',
|
||||
@@ -17,23 +27,5 @@ return [
|
||||
'verb' => 'GET',
|
||||
'requirements' => [],
|
||||
],
|
||||
[
|
||||
'name' => 'admin#save',
|
||||
'url' => '/admin/save',
|
||||
'verb' => 'POST',
|
||||
'requirements' => [],
|
||||
],
|
||||
[
|
||||
'name' => 'admin#load',
|
||||
'url' => '/admin/load',
|
||||
'verb' => 'GET',
|
||||
'requirements' => [],
|
||||
],
|
||||
[
|
||||
'name' => 'admin#getStatus',
|
||||
'url' => '/admin/status',
|
||||
'verb' => 'GET',
|
||||
'requirements' => [],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user