Enable users to execute workflows

This commit is contained in:
Deon George
2021-09-29 17:11:46 +10:00
parent 4243da9c32
commit 7acb9e964b
7 changed files with 10 additions and 7 deletions

View File

@@ -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();
}
/**

View File

@@ -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);