Linking security role references
To define and link the RoleReference security role reference for the BeanVisitor security role using Rational Application Developer, do the following:
From the Resource Perspective, navigate to the EJB deployment descriptor file, ebj-jar.xml, and open this file.
Select the References tab.
Select the bean containing the method which calls the isCallerInRole() method and click Add.... A pop-up window named Add Reference will open, as shown in Figure 7-4.
Figure 7-4 Adding security fole reference
In the Add Reference dialog, select Security Role Reference and click Next.
In the Add Security Role Reference dialog, fill in the values as shown in Figure 7-5. The reference's name is the string that is passed to isCallerInRole() method in the Java code. The desired security role is selected from the Link pull-down menu. Only security roles which have previously been defined in the EJB module are shown in this menu.
Figure 7-5 Linking security reference roleWe can also optionally enter a Description for this security role reference.
Click Finish to apply the changes and close the window. Save the deployment descriptor.
In Figure 7-6, we can see the Reference tab of the EJB deployment descriptor which shows added security reference role for the SecuredHello bean.
Figure 7-6 Reference tab of EJB deployment descriptor
Rational is a trademark of the IBM Corporation in the United States, other countries, or both.