2018-01-01 04:00:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
2018-02-12 13:39:52 +00:00
|
|
|
use App\Models\User;
|
2018-01-01 04:00:45 +00:00
|
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
|
|
|
|
|
|
class Policy
|
|
|
|
{
|
|
|
|
use HandlesAuthorization;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
2018-02-12 13:39:52 +00:00
|
|
|
public function before(User $user, $ability)
|
2018-01-01 04:00:45 +00:00
|
|
|
{
|
2018-02-12 13:39:52 +00:00
|
|
|
if ($user->can('manage_contents')) {
|
|
|
|
return true;
|
|
|
|
}
|
2018-01-01 04:00:45 +00:00
|
|
|
}
|
|
|
|
}
|