wip
This commit is contained in:
1 parent
29018914d1
commit
8cb1d428cb
17 files changed
+214
-165
No files matched your search
@@ -1,66 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\StatistikoConfig;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\Response;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class StatistikoConfigPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return false;
|
||||
return $authUser->can('ViewAny:StatistikoConfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, StatistikoConfig $statistikoConfig): bool
|
||||
public function view(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
|
||||
{
|
||||
return false;
|
||||
return $authUser->can('View:StatistikoConfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return false;
|
||||
return $authUser->can('Create:StatistikoConfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, StatistikoConfig $statistikoConfig): bool
|
||||
public function update(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
|
||||
{
|
||||
return false;
|
||||
return $authUser->can('Update:StatistikoConfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, StatistikoConfig $statistikoConfig): bool
|
||||
public function delete(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
|
||||
{
|
||||
return false;
|
||||
return $authUser->can('Delete:StatistikoConfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore the model.
|
||||
*/
|
||||
public function restore(User $user, StatistikoConfig $statistikoConfig): bool
|
||||
public function restore(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
|
||||
{
|
||||
return false;
|
||||
return $authUser->can('Restore:StatistikoConfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete the model.
|
||||
*/
|
||||
public function forceDelete(User $user, StatistikoConfig $statistikoConfig): bool
|
||||
public function forceDelete(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
|
||||
{
|
||||
return false;
|
||||
return $authUser->can('ForceDelete:StatistikoConfig');
|
||||
}
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:StatistikoConfig');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:StatistikoConfig');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
|
||||
{
|
||||
return $authUser->can('Replicate:StatistikoConfig');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:StatistikoConfig');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user