Skip to content

Commit

Permalink
fix: Don't require admin changes on controller actions
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnynotsolucky committed Dec 16, 2024
1 parent 5beb083 commit db00bd1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/controllers/SyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SyncController extends Controller

public function actionIndex(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
/** @var string $handle */
$handle = $this->request->getRequiredParam('handle');
Queue::push(new SyncJob([
Expand All @@ -28,14 +28,14 @@ public function actionIndex(): void

public function actionIndexAll(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
Queue::push(new SyncJob());
$this->setSuccessFlash('Job added to the queue to sync all indices.');
}

public function actionRefresh(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
/** @var string $handle */
$handle = $this->request->getRequiredParam('handle');
Queue::push(new RefreshJob([
Expand All @@ -46,14 +46,14 @@ public function actionRefresh(): void

public function actionRefreshAll(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
Queue::push(new RefreshJob());
$this->setSuccessFlash('Job added to the queue to refresh all indices.');
}

public function actionSettings(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
/** @var string $handle */
$handle = $this->request->getRequiredParam('handle');
$plugin = Plugin::getInstance();
Expand All @@ -65,7 +65,7 @@ public function actionSettings(): void

public function actionSettingsAll(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
$plugin = Plugin::getInstance();
/** @var Index[] $indices */
$indices = $plugin->getSettings()->getIndices();
Expand All @@ -78,7 +78,7 @@ public function actionSettingsAll(): void

public function actionFlush(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
/** @var string $handle */
$handle = $this->request->getRequiredParam('handle');
$plugin = Plugin::getInstance();
Expand All @@ -90,7 +90,7 @@ public function actionFlush(): void

public function actionFlushAll(): void
{
$this->requireAdmin();
$this->requireAdmin(false);
$plugin = Plugin::getInstance();
/** @var Index[] $indices */
$indices = $plugin->getSettings()->getIndices();
Expand Down

0 comments on commit db00bd1

Please sign in to comment.