Enable users to execute workflows
This commit is contained in:
@@ -48,9 +48,9 @@ class ServicePolicy
|
||||
* @param string $stage
|
||||
* @return bool
|
||||
*/
|
||||
public function progress(User $uo,Service $so,string $stage): bool
|
||||
public function progress(User $uo,Service $so,string $stage=''): bool
|
||||
{
|
||||
return $so->actions()->has($stage);
|
||||
return $stage ? $so->actions()->has(strtoupper($stage)) : $so->actions()->count();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1187,7 +1187,7 @@ class Service extends Model implements IDs
|
||||
// Check service is in the resellers/customers list
|
||||
case 'reseller':
|
||||
case 'customer':
|
||||
dd(['m'=>__METHOD__,'not written']);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
abort(500,'Unknown role for reseller: '.$role);
|
||||
@@ -1201,7 +1201,7 @@ class Service extends Model implements IDs
|
||||
|
||||
// Check service is in the customers list
|
||||
case 'customer':
|
||||
dd(['m'=>__METHOD__,'not written']);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
abort(500,'Unknown role for customer: '.$role);
|
||||
|
Reference in New Issue
Block a user