mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
v6 update
This commit is contained in:
20
app/Policies/ModulesPolicy.php
Normal file
20
app/Policies/ModulesPolicy.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Policies;
|
||||
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ModulesPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function manageModules(User $user)
|
||||
{
|
||||
if ($user->isOwner()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
20
app/Policies/OwnerPolicy.php
Normal file
20
app/Policies/OwnerPolicy.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Policies;
|
||||
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class OwnerPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function managedByOwner(User $user)
|
||||
{
|
||||
if ($user->isOwner()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -45,4 +45,13 @@ class SettingsPolicy
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function manageSettings(User $user)
|
||||
{
|
||||
if ($user->isOwner()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user