mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-16 10:22:55 -05:00
v5.0.0 update
This commit is contained in:
22
app/Policies/DashboardPolicy.php
Normal file
22
app/Policies/DashboardPolicy.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Policies;
|
||||
|
||||
use Crater\Models\Company;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Silber\Bouncer\BouncerFacade;
|
||||
|
||||
class DashboardPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function view(User $user, Company $company)
|
||||
{
|
||||
if (BouncerFacade::can('dashboard') && $user->hasCompany($company->id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user