이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 4. Authorization Modules
4.1. Custom Authorization Modules 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
In situations where the JBoss Data Virtualization built-in role mechanism is not sufficient, a custom
org.teiid.PolicyDecider
can be installed via a JBoss module. This is a two-stage process: first you must create a jar that contains your custom class, then you must expose the jar as a JBoss module so it can be seen by all of your classes.
- Implement the org.teiid.PolicyDecider interface and build a custom java class. If you are using maven as your build process, you can use the following dependencies:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The PolicyDecider interface is loaded by JBoss Data Virtualization using Java's standard service loader mechanism. For this to work, add the
META-INF/services/org.teiid.PolicyDecider
file with the full name of your PolicyDecider implementation class as its contents. Here is an example:org.jboss.teiid.auth.MyCustomPolicyDecider
org.jboss.teiid.auth.MyCustomPolicyDecider
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Package all of these files into a JAR archive.
- Create a directory called
[JDV_HOME]/modules/com/mycompany/main/
. - Copy your jar file into the newly-created directory.
- Create a module.xml file and also put it in the
[JDV_HOME]/modules/com/mycompany/main/
directory.Here is an example that shows dependencies specific to JBoss Data Virtualization:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
If your PolicyDecider has any third-party dependencies, add them as dependencies to themodule.xml
file. Ensure you list all the files required. If dependencies are missing you will be informed when you start the software. - After the module has been added, edit the server configuration file (
standalone.xml
or its equivalent) to use your module name. The module must be added to the "teiid" subsystem:<policy-decider-module>MODULE-NAME</policy-decider-module>
<policy-decider-module>MODULE-NAME</policy-decider-module>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the system.