concept method - permission in category ejb

appears as: method-permission
EJB 3 in Action, Second Edition

This is an excerpt from Manning's book EJB 3 in Action, Second Edition.

Table 13.2. One-to-one mapping between annotations and XML descriptor elements

Annotation

Type

Annotation element

Corresponding descriptor element

@Stateless EJB type   <session-type>Stateless
    name ejb-name
@Stateful EJB type   <session-type>Stateful
    name ejb-name
@MessageDriven EJB type   message-driven
    name ejb-name
@Remote Interface type   remote
@Local Interface type   Local
@TransactionManagement Transaction management type at bean level   transaction-type
@TransactionAttribute Transaction settings method   container-transaction trans-attribute
@Interceptors Interceptors   interceptor-binding interceptor-class
@ExcludeClassInterceptors Interceptors   exclude-classinterceptor
@ExcludeDefaultInterceptors Interceptors   exclude-defaultinterceptors
@AroundInvoke Custom interceptor   around-invoke
@PostActivate Lifecycle method   post-activate
@PrePassivate Lifecycle method   pre-passivate
@DeclareRoles Security setting   security-role
@RolesAllowed Security setting   method-permission
@PermitAll Security setting   unchecked
@DenyAll Security setting   exclude-list
@RunAs Security setting   security-identity run-as
@Resource Resource references (DataSource, JMS, environment, mail, and so on)   resource-ref resource-env-ref message-destination-ref env-ref
  Resource injection Setter/field injection injection-target
@EJB EJB references   ejb-ref ejb-local-ref
@Persistence-Context Persistence context reference   persistence-context-ref
@PersistenceUnit Persistence unit reference   persistence-unit-ref
Table A.5. Tags to configure <method-permission>

Tag name

Description

role-name Name of the roll allowed to execute the method. This or unchecked may be used but not both.
unchecked Specifies that all roles are allowed to execute the method. This or role-name may be used but not both.
method Specifies the name of the EJB (as specified in <session><ebj-name>) and the name of the method to secure.