Branch policy

This commit is contained in:
2023-11-30 16:15:30 +05:00
parent 9aa9d03059
commit fbe70ee0b2
2 changed files with 38 additions and 7 deletions

View File

@@ -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;
}
}