Database Reference
In-Depth Information
When there are many application proxies, having them all represented in a selectable table is easier
than having a check box for each proxy. The one drawback in selecting from a list like this is the
somewhat more likely possibility that an incorrect selection will be made and overlooked. For that
reason, we don't show the administrative proxy users in this list.
The drop-down combo box at the top of the Assign Applications screen is where we select a user. We
will be managing that user's access to applications. The far right table displays the list of proxy grants
already given to the selected user, and the middle table lists all the available proxy grants. When an
available proxy is selected, the far left table shows a list of applications in which that proxy is used. For
example, the appusr proxy is assigned to users of the HRVIEW application as well as the OJSADMIN
application.
These tables are a couple layers deep in nested GUI objects. Our tables reside in a scroll pane so that
when the table grows beyond what can be seen in the little box we've provided, we will have vertical
and/or horizontal scroll bars to give us access to the remaining data.
To add a proxy for the selected user, the Add Selected button will be pressed, and, likewise, to
revoke a proxy from the selected user, the Remove Selected button will be pressed. To save these new
settings, the application user will press the Save Updates button.
Initializing the Data Selection Components
When we instantiate a new AssignApp class, we will call the dataInit() method to populate three data-
selection components. We will build the list of users for our userComboBox , as we have seen in other
functional screens. We will also build a list of available application proxy accounts. And we will build a
lookup table of lists of applications where a proxy user is used. Then, when a proxy user is selected from
the available proxies list, we will display the associated list of applications in the far left column of the
Assign Applications screen.
In our list of available proxy users for applications, we will not provide a true list of available proxies,
because every Oracle user is in fact potentially a proxy-through user. We do not want to display all the
Oracle users, or incorrect selections are bound to happen. Rather, the proxy users we will show in the
available proxies list will be only those app_user entries from the appsec.v_application_registry view
that are not also security administration proxies. Recall that we grant and revoke access to the
administrative proxy users through the Admin Users screen. The available proxies will be the list of
app_user entries for all registered, non-administrative applications.
For our available proxies list, we are going to populate a new GUI widget called a JTable . It is not so
straightforward to populate the JTable as it was for our combo boxes. We cannot just call addItem() . In a
JTable , there is an underlying table model that we populate. We are using instances of the
DefaultTableModel that we declare as static members of AssignApps . This is shown in Listing 12-34.
Each table model has both data and column labels. The data and column labels can be provided to
the table model in a variety of forms, and we elect to provide both the data and column labels as Vectors .
We will only have a single column in our tables, which will be either a list of “Proxies” or a list of
“Applications.” Our column identifier vectors are defined as static members of AssignApp as shown in
Listing 12-34. If we had multiple columns in our tables, we would add a label for each column to our
column identifier Vectors . We do not have to tell the JTable how many columns of data we are going to
have—it divines that from the number of entries in our column identifiers Vector .
Listing 12-34. Static Members of Assign Applications
static DefaultTableModel availableProxiesTM = new DefaultTableModel();
static DefaultTableModel userProxiesTM = new DefaultTableModel();
static DefaultTableModel appsTM = new DefaultTableModel();
static Vector columnIdentifiers = new Vector();
 
Search WWH ::




Custom Search