Skip to content

Security context not working #209

Answered by edobrb
Atlinx asked this question in Q&A
May 25, 2022 · 1 comments · 14 replies
Discussion options

You must be logged in to vote

Hello, this is because you should specify the security domain of the operation inside the metadata of FindParams. For example see the following test, in particular the line 191:

const hotels = await entityManager.hotel.findAll({
projection: { id: true, name: true, totalCustomers: true },
filter: { name: { startsWith: 'AHotel' } },
metadata: { securityDomain: { hotelId: ['h1', 'h2'] } },
})
expect(hotels.length).toBe(2)

In order to do this you should specify the correct generic in the EntityManager, see line 17:

Replies: 1 comment 14 replies

Comment options

You must be logged in to vote
14 replies
@Atlinx
Comment options

@Atlinx
Comment options

@edobrb
Comment options

@edobrb
Comment options

@Atlinx
Comment options

Answer selected by Atlinx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants