Work on registration of existing systems to users
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user