acl icon indicating copy to clipboard operation
acl copied to clipboard

Getting "AclNode::node() - Couldn't find Aros node" error when saving associated entities with aliases

Open ricardoaranha96 opened this issue 4 years ago • 2 comments

Complete error message: AclNode::node() - Couldn't find Aros node identified by "Array ( [Aros0.model] => Clients [Aros0.foreign_key] => 6 ) "

I am trying to save a Proposal entity associated with the User entity by the alias "Clients":

$this->belongsTo('Sellers', [
    'foreignKey' => 'seller_user_id',
    'className' => 'Users'
]);
$this->belongsTo('Clients', [
    'foreignKey' => 'client_user_id',
    'className' => 'Users',
]);

This user that I am trying to save already exists in the aros table but with the model "Users".

The Acl plugin is supposed to support this kind of configuration or is it a bug?

ricardoaranha96 avatar Sep 17 '20 18:09 ricardoaranha96

I think you would need to create real Client class and set it up as an Acl requester.

rchavik avatar Sep 18 '20 06:09 rchavik

I think you would need to create real Client class and set it up as an Acl requester.

I didn't have time to try this during the week, but I believe that your suggestion would create a new aro of the same user but with the model field as "Clients". Am I right? If so, is there a way to keep this alias on the relationship but configure Acl to use the "className" instead of the alias?

ricardoaranha96 avatar Sep 24 '20 03:09 ricardoaranha96