Progress on order progress
This commit is contained in:
@@ -23,10 +23,10 @@ class ServicePolicy
|
||||
// If this is a service for an account managed by a user.
|
||||
return ($user->services->pluck('id')->search($o->id))
|
||||
|
||||
// The user is the wholesaler
|
||||
// The user is the wholesaler
|
||||
OR $user->isWholesaler()
|
||||
|
||||
// The user is the reseller
|
||||
// The user is the reseller
|
||||
OR $user->all_accounts()->pluck('id')->search($o->account_id);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,18 @@ class ServicePolicy
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can the user progress an order status
|
||||
*
|
||||
* @param User $user
|
||||
* @param Service $o
|
||||
* @return bool
|
||||
*/
|
||||
public function progress(User $user, Service $o,string $next)
|
||||
{
|
||||
return $o->actions()->has($next);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the service.
|
||||
*
|
||||
|
Reference in New Issue
Block a user