security-role security-role-ref ejb-jar.xml Deployment Descriptors

6-8 Programming Security for Oracle WebLogic Server

6.3.1.5.2 Example For an example of how to use the security-identity element,

see Example 6–3 and Example 6–8 .

6.3.1.6 security-role

The security-role element contains the definition of a security role. The definition consists of an optional description of the security role, and the security role name.

6.3.1.6.1 Used Within The security-role element is used within the

assembly-descriptor element.

6.3.1.6.2 Example For an example of how to use the assembly-descriptor element,

see Example 6–1 .

6.3.1.7 security-role-ref

The security-role-ref element contains the declaration of a security role reference in the enterprise beans code. The declaration consists of an optional description, the security role name used in the code, and an optional link to a security role. If the security role is not specified, the Deployer must choose an appropriate security role. The value of the role-name element must be the String used as the parameter to the EJBContext.isCallerInRoleString roleName method or the HttpServletRequest.isUserInRoleString role method.

6.3.1.7.1 Used Within The security-role-ref element is used within the entity

and session elements.

6.3.1.7.2 Example For an example of how to use the security-role-ref element, see

Example 6–2 . Example 6–2 Security-role-ref Element Example DOCweblogic-ejb-jar xmlns=http:www.bea.comnsweblogic90 xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:www.bea.comnsweblogic90 http:www.bea.comnsweblogic90weblogic-ejb-jar.xsd ejb-jar enterprise-beans ... session ejb-nameSecuritySLEJBejb-name homeweblogic.ejb20.security.SecuritySLHomehome remoteweblogic.ejb20.security.SecuritySLremote ejb-classweblogic.ejb20.security.SecuritySLBeanejb-class session-typeStatelesssession-type transaction-typeContainertransaction-type security-role-ref role-namerolenamedifffromlinkrole-name role-linkrole121SLrole-link security-role-ref security-role-ref role-nameroleForRemotesrole-name role-linkroleForRemotesrole-link security-role-ref security-role-ref role-nameroleForLocalAndRemoterole-name role-linkroleForLocalAndRemoterole-link Securing Enterprise JavaBeans EJBs 6-9 security-role-ref session ... enterprise-beans ejb-jar

6.3.1.8 unchecked