Work on registration of existing systems to users

This commit is contained in:
Deon George
2022-03-14 22:28:54 +11:00
parent d68307461e
commit 8072f7c5a9
19 changed files with 553 additions and 56 deletions

View File

@@ -26,6 +26,18 @@ class SystemPolicy
return ($user->isAdmin() || (! $system->exists));
}
/**
* Can the user register this system
*
* @param User $user
* @param System $system
* @return bool
*/
public function register(User $user,System $system): bool
{
return ! $system->users->count() || $system->users->has($user);
}
/**
* Determine whether the user can update the model.
*