diff --git a/startup_details.php b/startup_details.php index b2bfb42..a847357 100644 --- a/startup_details.php +++ b/startup_details.php @@ -36,9 +36,11 @@ if (!$startup) { // Check if user is the founder or an investor $isFounder = ($_SESSION['user_id'] == $startup['founder_id']); $isInvestor = ($user['role'] == 'investor'); +$isAnyFounder = ($user['role'] == 'founder'); // Basic permissions check -if (!$isFounder && $startup['status'] === 'private' && !$isInvestor) { +// Allow if: is the founder, OR is an investor, OR is any founder (for partnership), OR startup is public +if (!$isFounder && !$isInvestor && !$isAnyFounder && $startup['status'] === 'private') { die("You do not have permission to view this profile."); } @@ -485,6 +487,54 @@ $progress = ($goal > 0) ? round(($raised / $goal) * 100) : 0;
+ + +