26 lines
531 B
PHP
26 lines
531 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Policies;
|
||
|
|
|
||
|
|
use App\Models\MovieList;
|
||
|
|
use App\Models\User;
|
||
|
|
|
||
|
|
class MovieListPolicy
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Create a new policy instance.
|
||
|
|
*/
|
||
|
|
public function __construct()
|
||
|
|
{
|
||
|
|
//
|
||
|
|
}
|
||
|
|
|
||
|
|
public function update(User $user, MovieList $movieList)
|
||
|
|
{
|
||
|
|
// If the user is the owner of the movie list or has been added as an editor for
|
||
|
|
// the movie list, allow them to update it.
|
||
|
|
|
||
|
|
return $movieList->owner()->id = $user->id; //|| $movieList->editors->contains($user->id);
|
||
|
|
}
|
||
|
|
}
|