laravel-learn-bbs/app/Policies/Policy.php

24 lines
350 B
PHP
Raw Permalink Normal View History

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