|
Configuring Roles This article describes what Roles are and how they are normally configured and referenced in a J2EE Application module. 1 Introduction This article describes what Roles are and how they are normally configured and referenced in a J2EE Application module. 2 Overview When you develop J2EE applications you normally only concern yourself with what security roles that are to have or not have access to a certain resource. Thinking in terms of security roles make it easy for you to think of how users will use your application without actually specifying whose these users are. When a J2EE application is deployed, the deployer maps these roles to security identities (users and groups in Orion Application Server). 3 Role-based Access-control As a developer, you can use both declarative and programmatic security to limit access to certain resources. Declarative security means that you are using the deployment descriptor to define security settings.
Programmatic security means that you are using methods available in the Containers API to define security settings.
4 Configuring Roles In order to set up access restrictions your J2EE module needs to know the security roles that is has to handle. This is done through a list like the one shown in listing 3 below.
These declarations look the same in a Web-module as in a EJB-module, as shown in listing 4 below.
By adding an entry like the ones seen above to the application.xml of a Application, the Server will recognize the Roles that this Application uses. These Roles does not need to be defined in each single module as long as the modules does not define any module specific behaviour for the Role. Such behaviour could for instance be a "run-as" directive in a ejb-jar.xml file or an "auth-constraint" of an Web-module. For more information about Roles, please see Sun's J2EE tutorial. Copyright © 2005 IronFlare AB |