Skip to content

Commit

Permalink
Merge pull request #10526 from nextcloud/bug/noid/filter-for-non-admins
Browse files Browse the repository at this point in the history
fix: make filter routes available for normal users
  • Loading branch information
kesselb authored Dec 23, 2024
2 parents 2c5cb31 + 95984e8 commit c47aa4e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Controller/FilterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
use OCA\Mail\AppInfo\Application;
use OCA\Mail\Service\AccountService;
use OCA\Mail\Service\FilterService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\Route;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\OCSController;
use OCP\IRequest;

class FilterController extends OCSController {
class FilterController extends Controller {
private string $currentUserId;

public function __construct(
Expand All @@ -31,7 +32,9 @@ public function __construct(
$this->currentUserId = $userId;
}


#[Route(Route::TYPE_FRONTPAGE, verb: 'GET', url: '/api/filter/{accountId}', requirements: ['accountId' => '[\d]+'])]
#[NoAdminRequired]
public function getFilters(int $accountId) {
$account = $this->accountService->findById($accountId);

Expand All @@ -45,6 +48,7 @@ public function getFilters(int $accountId) {
}

#[Route(Route::TYPE_FRONTPAGE, verb: 'PUT', url: '/api/filter/{accountId}', requirements: ['accountId' => '[\d]+'])]
#[NoAdminRequired]
public function updateFilters(int $accountId, array $filters) {
$account = $this->accountService->findById($accountId);

Expand Down

0 comments on commit c47aa4e

Please sign in to comment.