You can translate the question and the replies:

Access to view data in CustomPolicy class

We have a need where we will receive user roles as a view parameter value, then that parameter will be parsed within a custom policy to make sure the role exist, then that role needs to be translated to actual values (which exists in a view within a common database) and then use those values and accept/reject/mask. For example, a view will receive a parameter including USER_HAS_MBR_ACCESS, USER_HAS_CLIENT!, USER_HAS_CLIENT2. Also, this vies is assigned with a CUSTOM_POLICY which cares about roles USER_HAS_CLIENT! and USER_HAS_CLIENT2. So, in the execute method of the CUSTOM_POLICY, the paramenter will be parsed to make sure these ROLES exists. Then these parameters needs to be translated i.e. USER_HAS_CLIENT1 to 1234, USER_HAS_CLIENT2 to 5678 so on and so forth. This information will reside in another common database view. Is it a possibility to access that view within the CustomPolicy class? Please advise.
03-06-2020 16:31:25 -0400

3 Answers

Hi, From your question, I understand that you would like to access a view which is in the Virtual DataPort server, to do that, you could make an internal JDBC connection to the Virtual DataPort Server in the Custom Policy and query the view. Having said that, you could either hardcode the Virtual DataPort server username/password or you could make it to be read from a .properties file in your Custom Policy. Hope this helps!
Denodo Team
05-06-2020 00:39:53 -0400
Thanks for your response. Adding an internal JDBC connection adds additional overhead. Is it an option for future releases to have DatabaseEnvironment or a similar class available in custom policies like it is in stored procedures classes?
05-06-2020 08:35:31 -0400
Hi, For now, you could make an internal JDBC connection with Virtual DataPort Server in order to access a view and the ability to access the VDP connection and allow issuing queries like in Stored Procedures from a custom policy is in the Denodo roadmap, so probably it will be added in future updates Hope this helps!
Denodo Team
16-06-2020 00:02:45 -0400
You must sign in to add an answer. If you do not have an account, you can register here