Skip to content

Commit

Permalink
Do not allow viewing unapproved activities by the world
Browse files Browse the repository at this point in the history
If an activity is not `APPROVED` it is only accessible to the board
and the organiser.
  • Loading branch information
tomudding committed Sep 11, 2023
1 parent 9bb5387 commit d76b488
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions module/Activity/src/Controller/ActivityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public function viewAction(): mixed
return $this->notFoundAction();
}

if (ActivityModel::STATUS_APPROVED !== $activity->getStatus()) {
if (!$this->aclService->isAllowed('update', $activity)) {
return $this->notFoundAction();
}
}

// If the Activity has a sign-up list always display it by redirecting the request.
if (0 !== $activity->getSignupLists()->count()) {
return $this->forward()->dispatch(
Expand Down

0 comments on commit d76b488

Please sign in to comment.