Skip to content

Commit

Permalink
🐛 Fixes Profile Policy
Browse files Browse the repository at this point in the history
fixes PROFILES-6M
  • Loading branch information
wunc committed Nov 14, 2024
1 parent 8fb68f3 commit 33664ba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Policies/ProfilePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public function view(?User $user, Profile $profile)
return $profile->public;
}

return $profile->public ||
$user->hasRole(['site_admin', 'profiles_editor']) ||
$user->owns($profile, true) ||
$this->checkSchoolEditor($user, $profile) ||
$this->checkDepartmentEditor($user, $profile);
return $profile->public || ($user && (
$user->owns($profile, true) ||
$this->checkSchoolEditor($user, $profile) ||
$this->checkDepartmentEditor($user, $profile)
));
}

/**
Expand Down

0 comments on commit 33664ba

Please sign in to comment.