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.6. Restricting Access to Groups based on Authorization Information<br />

When you have checked the service-level checkbox Use Role-based Authorization and<br />

you selected an Authorization Type, you can restrict access to the pages generated for<br />

each group by specifying roles or permissions. This can be done using the group level<br />

property Authorized Roles/Permissions where you can specify a comma-separated list<br />

of roles and/or permissions. If the user is granted at least one of the roles or permissions,<br />

he is authorized to access the page.<br />

If this property is not set, the pages generated for this group are public, and do not<br />

require a specific user role or permission.<br />

If you protect group pages using this property, <strong>JHeadstart</strong> will implement this restriction<br />

in both the View and Controller layer:<br />

10.6.1. Restricting Group Access using Permissions<br />

• View layer (JSF pages): Hide tabs and navigation buttons that go to a page of<br />

that group if the currently logged-in user is not authorized. See section<br />

<strong>JHeadstart</strong> Authorization Proxy for more information on how this is<br />

implemented.<br />

• Controller Layer: If the user tries to directly access an unauthorized page by<br />

“hacking” the browser URL, he should still be denied access. <strong>JHeadstart</strong><br />

performs this check for you. See section <strong>JHeadstart</strong> Authorization Proxy for<br />

more information on how this is implemented.<br />

The above example used role names to restrict access to a particular group. As explained<br />

in section Hardcoding Roles or Permissions in Application Code you might prefer to<br />

authorize using permission names. To do so, you check the service-level checkbox<br />

Authorize Using Group Permissions.<br />

Note that this property can be used regardless of the values set for Authentication Type<br />

and Authorization Type.<br />

When you generate your application with this setting, the following happens<br />

• All groups are protected using the group name as permission name. This means<br />

that you do not have to specify the Authorized Role/Permissions property for<br />

each and every group. You can still specify this property at the group level, to<br />

override the default group name permission.<br />

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

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

Saved successfully!

Ooh no, something went wrong!