- 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.
32 lines
578 B
PHP
32 lines
578 B
PHP
<?php
|
|
|
|
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',
|
|
'url' => '/admin',
|
|
'verb' => 'GET',
|
|
'requirements' => [],
|
|
],
|
|
],
|
|
];
|