| Red Hat Docs > Manuals > Red Hat Web Application Framework > |
The permissions UI provides reusable components for building customized permission administration interfaces.
The default implementation of it resides under /permissions/. It supports a standard set of permissions, namely, READ, WRITE, CREATE, DELETE, ADMIN. A user or group with admin privilege on an object can share the privileges with other parties using this interface.
There are two requirements to show an object's permission tables.
The viewing user must be authenticated, that is, logged in recently so that his userID can be read from the user cookie.
The ACSObject's ID must be in the page state as a global parameter (current implementation to support URL redirects and URL referencing in Red Hat Web Application Framework Tcl style).
The first step is to create the embedding bebop Page for the permissions UI. A simple example is ObjectPermissionsPage.java. This only has a UserAuthenticationListener in the constructor and builds a PermissionsPane using the default constructor. Note, that the default constructor will give you the permissions table with READ, WRITE, CREATE, DELETE, ADMIN privileges (as defined in PermissionsConstants.java). You can use
PermissionsPane(PrivilegeDescriptor[] privs) |
(1) it implements the generic permissions UI for ACSObjects,
(2) it provides getter methods to retrieve only parts of the interface.
public void register(Page p), public void showAdmin(PageState s), public void showGrant(PageState s), public void showNoResults(PageState s). |
public Party getRequestingUser(PageState s)
public ACSObject getObject(PageState s)
public Label getTitle()
public String[] getPrivileges()
private PermissionsTables getPermissionsTables()
public SimpleContainer getDirectPermissionsPanel()
public SimpleContainer getInheritedPermissionsPanel()
public Form getUserSearchForm()
public SimpleContainer getPermissionGrantPanel()
public SimpleContainer getPermissionsHeader()
public SimpleContainer getNoSearchResultPanel()
public SimpleComponent getContextPanel()
Note, if you want the same HTML style as in the default implementation, you MUST import the permissions.xsl stylesheet in the application's stylesheet, for example:
<xsl:import href="../../content-section/xsl/permissions.xsl"/> |