Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 199 forks source link

Policy check #194

Closed m33ch closed 4 years ago

m33ch commented 7 years ago

Hi all,

i have User, Album and Artist entities. User has albums relation like this:

public function albums($morph = null)
{
    return $this->hyperMorph($morph, 'Album', 'PUBLISH', 'ON');
}

Artist has albums relation:

public function albums()
{
   return $this->morphMany('Album', 'ON');
}

And Album has author relation:

public function author()
{
     return $this->morphTo();
}

When i create an album i associate it to artist like this:

$user->albums($artist)->save($album);

My problem is when i try to update an album. How to check if logged user can update album?

I try to check it in various methods, but i not found a correct method.

Thanks

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.