2018-01-01 04:00:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
use App\Models\Topic;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
class TopicPolicy extends Policy
|
|
|
|
{
|
|
|
|
public function update(User $user, Topic $topic)
|
|
|
|
{
|
2018-01-01 13:22:16 +00:00
|
|
|
return $user->isAuthorOf($topic);
|
2018-01-01 04:00:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function destroy(User $user, Topic $topic)
|
|
|
|
{
|
2018-01-01 13:22:16 +00:00
|
|
|
return $user->isAuthorOf($topic);
|
2018-01-01 04:00:45 +00:00
|
|
|
}
|
|
|
|
}
|