Branch policy
This commit is contained in:
@@ -12,7 +12,11 @@ class BranchPolicy
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,7 +24,11 @@ class BranchPolicy
|
||||
*/
|
||||
public function view(User $user, Branch $branch): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28,7 +36,11 @@ class BranchPolicy
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,7 +48,11 @@ class BranchPolicy
|
||||
*/
|
||||
public function update(User $user, Branch $branch): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +60,11 @@ class BranchPolicy
|
||||
*/
|
||||
public function delete(User $user, Branch $branch): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +72,11 @@ class BranchPolicy
|
||||
*/
|
||||
public function restore(User $user, Branch $branch): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +84,10 @@ class BranchPolicy
|
||||
*/
|
||||
public function forceDelete(User $user, Branch $branch): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user