User register system, minor cosmetic changes, start of user authorisation

This commit is contained in:
Deon George
2021-11-11 22:57:13 +11:00
parent a0db589dc5
commit 3c8895a238
15 changed files with 488 additions and 206 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use App\Models\{System,User};
class SystemPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can update the model.
*
* @param \App\Models\User $user
* @param \App\Models\System $system
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update(User $user, System $system)
{
return (! $system->exists) || $system->users->contains($user) || $user->isAdmin();
}
}