João Victor
João Victor

Reputation: 1

Casl - How to allow access to related entities?

I am building a nestjs app with CASL as a access control library. But I ran into a problem which I can't find an easy solution to: If a user has a read access to an entity, he should also have access to read other entities that are related(with key-foreign keys) to it. I am using typeorm and all entities are correctly mapped to each other.

I am expecting something like this:

can(Action.Manage, EntityX, { someField: true });
can(Action.Manage, EntityY, { entityxId :  EntityX.id });

but it seems that CASL doesn't support it.

Upvotes: 0

Views: 142

Answers (0)

Related Questions