Skip to content

Commit

Permalink
Allow all student council members to view users (#652)
Browse files Browse the repository at this point in the history
Other members of the student council might have legitimate reasons to
view collegists' data (e.g. to obtain contact information). This policy
change was approved by the director.
  • Loading branch information
BertalanD authored Oct 16, 2024
1 parent 0226e08 commit 323b42e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Policies/UserPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function viewAll(User $user): bool
Role::SECRETARY,
Role::DIRECTOR,
Role::STUDENT_COUNCIL_SECRETARY,
Role::STUDENT_COUNCIL => Role::STUDENT_COUNCIL_LEADERS,
Role::STUDENT_COUNCIL => array_merge(Role::STUDENT_COUNCIL_LEADERS, Role::COMMITTEE_LEADERS),
]);
}

Expand Down Expand Up @@ -68,7 +68,7 @@ public function viewAny(User $user): bool
Role::WORKSHOP_ADMINISTRATOR,
Role::WORKSHOP_LEADER,
Role::STUDENT_COUNCIL_SECRETARY,
Role::STUDENT_COUNCIL => Role::STUDENT_COUNCIL_LEADERS,
Role::STUDENT_COUNCIL => array_merge(Role::STUDENT_COUNCIL_LEADERS, Role::COMMITTEE_LEADERS),
]);
}

Expand Down Expand Up @@ -102,7 +102,7 @@ public function view(User $user, User $target): bool
return $user->hasRole([
Role::SECRETARY,
Role::DIRECTOR,
Role::STUDENT_COUNCIL => Role::STUDENT_COUNCIL_LEADERS,
Role::STUDENT_COUNCIL => array_merge(Role::STUDENT_COUNCIL_LEADERS, Role::COMMITTEE_LEADERS),
Role::STUDENT_COUNCIL_SECRETARY,
]);
})) || $target->workshops
Expand Down

0 comments on commit 323b42e

Please sign in to comment.