User register system, minor cosmetic changes, start of user authorisation
This commit is contained in:
24
app/Policies/SystemPolicy.php
Normal file
24
app/Policies/SystemPolicy.php
Normal 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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user