refactor(controller): usage of attributes instead of annotations
This commit is contained in:
@@ -28,6 +28,10 @@ use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\IRequest;
|
||||
use OCP\IUserSession;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\PublicPage;
|
||||
use OCP\AppFramework\Http\Attribute\FrontpageRoute;
|
||||
|
||||
class NavController extends Controller
|
||||
{
|
||||
@@ -43,11 +47,10 @@ class NavController extends Controller
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @PublicPage
|
||||
*/
|
||||
#[NoCSRFRequired]
|
||||
#[NoAdminRequired]
|
||||
#[PublicPage]
|
||||
#[FrontpageRoute(verb: 'GET', url: '/nav/items')]
|
||||
public function items(): JSONResponse
|
||||
{
|
||||
$user = OC::$server[IUserSession::class]->getUser();
|
||||
|
||||
Reference in New Issue
Block a user