14.01.2013 Views

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.1.4. Custom Security<br />

10.1.5. ADF Model Security<br />

• The “Jobs.Update” permission determines how the items on the Edit Job page<br />

will be rendered: as read only when the user does not have a role with this<br />

permission, or as updateable when the user does have this permission.<br />

• The “Jobs.Delete” permission determines whether the “Delete Job” button is<br />

rendered.<br />

By hardcoding permission names in application code, the security schema of your<br />

application is fully configurable at runtime, new roles can be added and existing roles<br />

can be deleted or changed by adding or removing permissions, without changes to the<br />

application code. Adding new permissions still requires a new application code release,<br />

but this release was needed anyway to add the new application function that is to be<br />

secured by the new permission.<br />

To use permission-based security with <strong>JHeadstart</strong>, you check the service-level checkbox<br />

Authorize Using Group Permissions?.<br />

<strong>JHeadstart</strong> comes with a set of database tables to store the role and permission<br />

information, and an administration application that can be used to maintain this<br />

information. When used in combination with JAAS-based authorization, <strong>JHeadstart</strong><br />

performs the authorization check by first looking up all the roles that provide access to a<br />

permission and then make the isUserInRole()API call to check whether the user has<br />

access to such a role.<br />

Instead of using JAAS, you can use the <strong>JHeadstart</strong> custom security mechanism. This is<br />

implemented in application logic using a servlet filter that redirects to a login page when<br />

an unauthenticated user tries to access a secured application. When the user submits the<br />

login page, custom logic fires to authenticate the user and to retrieve the user’s roles and,<br />

optionally, permissions.<br />

Historically, a common reason for implementing security this way is that the security<br />

information is stored in the same database as the application tables and is accessed using<br />

the Business Service layer of the application.<br />

Note however that by using a JAAS Custom Login Module, the same database tables<br />

could be accessed. The only drawback of using JAAS is the double maintenance of role<br />

information; new roles must be added to the web.xml as well.<br />

ADF allows you to secure the executables (iterator bindings), action and value bindings<br />

defined in the ADF page definitions, part of the ADF Model layer (also known as ADF<br />

Data Bindings layer).<br />

This provides additional security on top of the security defined in the View layer. If, for<br />

example the user is now allowed to create a new employee, the “New Employee” button<br />

is typically hidden in the user interface. Using ADF Model Security, an additional check<br />

can be added on the “CreateEmployee” action binding in the page definition. Should the<br />

user somehow manage to submit an HTTP request to create a new employee, the ADF<br />

Model layer will prevent this and raise an application error as the user does not have the<br />

privilege to execute the “CreateEmployee” action binding.<br />

<strong>JHeadstart</strong> Developer’s <strong>Guide</strong> Application Security 10- 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!