-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Not sure if this is a bug or not. You can close it without any explanation if you think so.
First, our stack is a bit odd because we use TwigBridge and twig templates and we haven't checked the following issue on blade .
{{auth_user().can('update', item)}} returns always false.
Further investigation we discovered that check is false because the DI cannot resolve item as item is a Presentable instance.
As object attribute is protected we cannot straight forward do {{auth_user().can('update', item.object)}}. For this to work had created a trait with method:
public function presentObject()
{
return $this->object;
}
Now {{auth_user().can('update', item.object)}} works properly.
Metadata
Metadata
Assignees
Labels
No labels