EJB 2.0 authorization of methods with no defined permissions

For EJB 2.0 components, if there are no roles associated with a method, then access is denied to everyone, which is different from EJB version 1.x. Keep this in mind when upgrading from EJB version 1.x to 2.0.

NoteThe com.sybase.jaguar.server.ejb.role.default property affects only EJB 2.0 components, not EJB 1.1 or 1.0 components.

Usually a role reference is mapped to a J2EE role. However, sometimes the mapping to the J2EE role may be missing, either intentionally, or due to mappings or customization not being performed after you deploy a J2EE application. In some cases, the mapping of the J2EE role to the EAServer role is missing. The following describes the behavior of the server in such cases:

  1. If a role reference to J2EE role mapping is located, then a mapping between the J2EE role and an EAServer role is searched. If the search fails, role checks are performed against the J2EE role directly. If the search succeeds, then role checks are performed against the EAServer role.

  2. If the role reference to J2EE role mapping search fails, then a mapping between the role reference and an EAServer role is performed. If a match is found, role checks are performed against the EAServer role. Otherwise, role checks are performed against the role reference directly.

In some EAServer and application configurations, the role reference name, the J2EE role name, and EAServer role name may be the same. In such cases, even though the mappings have not been explicitly set by the deployer at run time the server uses the default behavior, and EAServer performs the role checks internally against the EAServer role. In some application environments, this may be the intended and desired behavior, while in other environments, this may be unintended.

Role checks performed against a role that is not defined in the repository fail. If there is a role service or an authorization service, these services are consulted. See Chapter 10, “Creating and Using Custom Security Components.”

NoteEJB 2.0 authorization For an EJB 2.0 bean, if there are no method permissions defined for all methods, no authorization checks are performed, and access is granted to any user. If however, any one method has a permission assigned to it, then you must assign permissions to all methods to allow client access, otherwise, your clients will be denied access due to an authorization failure.