Dealing with 2 repeat data sets

I have a list of roles a user has and then a list of what roles are allowed to view the current page.

these are returned by 2 queries

Lets say the users has roles
Gaming
Developer
Tester

And the page allows
Developer
Tester

I need to check if the user has either of the roles the page allows in the case Developer and Tester.
If the user doesn’t have either of the roles return a 403 response.

My first thought was repeat the data the page allows and use a IN check in the repeat on the users roles but im having issues doing the IN from a query directly and not sure how to make the values into a array on server side

I can’t help with the access issue, but I’ve had issues with the IN operator, especially in custom queries.

I have had great success using the ANY operator though (in postgres) and it’s been great…works perfectly and quite powerful.

Worth a Google search if it’s relevant to you.

Ill have a look into this thanks