feat: integrate private offers with existing editorial workflow
This commit is contained in:
@@ -241,7 +241,7 @@ class PortalProfileAccess
|
||||
|
||||
public function canEdit(User $actor, Opportunity $record, ?string $newType = null): bool
|
||||
{
|
||||
if ($record->isPrivateOfferPreparation() && data_get($record->workflow_context, 'private_offer_preparation.state') !== 'draft') {
|
||||
if ($record->isPrivateOfferPreparation() && ! in_array($this->state($record), ['draft', 'needs_information'], true)) {
|
||||
return false;
|
||||
}
|
||||
if ($record->owner_user_id === null) {
|
||||
@@ -267,6 +267,10 @@ class PortalProfileAccess
|
||||
|
||||
public function state(Opportunity $record): string
|
||||
{
|
||||
if ($record->isPrivateOfferPreparation()) {
|
||||
return data_get($record->workflow_context, 'private_offer_preparation.state', 'draft');
|
||||
}
|
||||
|
||||
return $record->workflow_context['working_state'] ?? $record->status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user