# @ejbgen:role-mapping Annotation

This tag defines an EJB-scoped security role used by the beans in an EJB Project. In addition, the tag defines the role-principal mapping or refers to an externally defined security role for the role-principal mapping definition. An externally defined role can be a security role with application-scope or it can be a global security role defined in the domain's security realm. For more information on security roles, see Role-Based Security.

## Scope

Class tag on session and entity beans.

## Syntax

@ejbgen:role-mapping

[global-role="True/False"]

[id="TagID"]

[principals="PrincipalsList"]

role-name="NameRole"

## Attributes

global-role

Optional. Specifies whether this security role is externally defined. Specify True if the role is externally defined, otherwise do not specify this attribute.

id

Optional. Specifies the ID of the tag. For more information, see EJBGen Tag Inheritance.

principals

Optional. Specifies the names of the principals in this role (separated by commas). When the security role is EJB-scoped, this attribute must be specified.

role-name

Required. Specifies the name of the role.

Related Topics

Role-Based Security