You can translate the question and the replies:

Roles Assignment

Hi, I understand that it is possible to assign multiple roles to a specific user, and the result will be of UNION. However, is there other way to achieve the following outcome? Assuming there are several records in the database and there are 2 fields (Color and Shape), with their unique values as: a) Color - Blue, Green, Yellow. b) Shape - Square, Round, Oval. A user was assigned to 2 roles as: 1) "color role" (with view restriction configured to filter only for Blue records). 2) "shape role" (with view restriction configured to filter only for Oval records). I would like to achieve records that will return only those with Blue **and** Oval. However now, since it's of UNION, I get records with Blue **or** Oval instead.
user
14-01-2021 01:06:55 -0500
code

1 Answer

Hi, I can think of the following way as a possible solution for your requirement. * Create a UNION derived view combined Color field and Shape field and access it by user with the two roles Additionally, I found another approach that uses [Custom Policy](https://community.denodo.com/docs/html/browse/latest/vdp/developer/custom_policies/custom_policies) which is similar to row restrictions with the benefit can be customized. I would suggest you to refer the sample Custom Policy available under the directory to more insights on custom policy creation. <DENODO_HOME>/samples/vdp/customPolicies I referred to the following user manual, I believe it should be helpful to you. * [Developing a Custom Policy](https://community.denodo.com/docs/html/browse/latest/vdp/developer/custom_policies/developing_a_custom_policy) Hope this helps!
Denodo Team
15-01-2021 04:22:23 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here