Adding security role references
EJB modules must define security role references for all of the security role names that are used in the enterprise bean code or that are defined in the deployment descriptor. You can use the EJB deployment descriptor editor to declare the security role references.
Each security role reference that you declare in your EJB module uses the security-role-ref element in deployment descriptor. If the security role is declared in the deployment descriptor, use the role-link element in the security-role-ref element to link the reference to the declared security role.
To define a security role reference:
- Open the Add Reference wizard from the EJB module where you are declaring the security role reference.
- Select Security role reference and click Next.
- In the Name field, specify a name for the reference, or accept the default name provided by the wizard (recommended). The value entered in the Name field is used in the role-name entry in the deployment descriptor.
The name must be the security role name that is used as a parameter to javax.ejb.EJBContext.isCallerInRole(String roleName).
- In the Link drop-down, if the security role that you are referencing is declared in the deployment descriptor, select the security role. The value in the Link field is used in the role-link entry in the deployment descriptor.
- In the Description text area, enter a description for the reference.
- Click Finish.
Related concepts
Client Deployment Descriptor editor
Related tasks
Defining references in J2EE modules
Adding EJB references
Adding message destination references
Adding resource manager connection factory references
Adding resource environment references
Adding Web service references