getPleb(); if (! $pleb) { return false; } return $pleb->isBoardMember() || $pleb->hasPaidMembership(); } /** * Determine whether the user can update the project proposal. * Allowed for: the creator OR board members. */ public function update(NostrUser $user, ProjectProposal $projectProposal): bool { $pleb = $user->getPleb(); if (! $pleb) { return false; } return $pleb->id === $projectProposal->einundzwanzig_pleb_id || $pleb->isBoardMember(); } /** * Determine whether the user can delete the project proposal. * Allowed for: the creator OR board members. */ public function delete(NostrUser $user, ProjectProposal $projectProposal): bool { $pleb = $user->getPleb(); if (! $pleb) { return false; } return $pleb->id === $projectProposal->einundzwanzig_pleb_id || $pleb->isBoardMember(); } /** * Determine whether the user can accept/reject the project proposal. * Only board members can change the accepted flag and sats_paid. */ public function accept(NostrUser $user, ProjectProposal $projectProposal): bool { $pleb = $user->getPleb(); if (! $pleb) { return false; } return $pleb->isBoardMember(); } }