Database Reference
In-Depth Information
);
/
CREATE OR REPLACE VIEW appsec.v_application_admins
AS SELECT * FROM appsec.t_application_admins;
INSERT INTO appsec.v_application_admins
( class_name, user_id )
( SELECT DISTINCT class_name, 'OSADMIN' FROM appsec.t_app_conn_registry );
COMMIT;
We are going to get a start on listing individual administrators for various applications by initially
assigning administration of all the applications to the user we are calling osadmin . We do that with a
single insert command shown in Listing 12-46, and we commit the insert.
There is a second table that we are going to create here, the appsec.t_app_class_id table. When
each application was managed individually, as we have done up through Chapter 11, we automatically
knew what application we were working on. However, in this security administration interface
application, we are managing all applications. Now we need to symbolically associate an application
with its application inner class and list of connection strings. This association is necessary in order to
keep from having to type in both the application ID and the inner class name whenever we want to
specify an application.
An example entry in the t_app_class_id table is for this application: the class name is
orajavsec.Login$InnerRevLvlClass , and the application id is OJSADMIN . Listing 12-47 shows the script we
will use to build and populate the table.
Listing 12-47. Application Class to ID Table
CREATE TABLE appsec.t_app_class_id
(
class_name VARCHAR2(2000 BYTE) NOT NULL ENABLE,
application_id VARCHAR2(24 BYTE) NOT NULL ENABLE
);
/
CREATE UNIQUE INDEX app_class_id_pk ON appsec.t_app_class_id
( class_name, application_id );
ALTER TABLE appsec.t_app_class_id ADD (
CONSTRAINT app_class_id_pk
PRIMARY KEY
( class_name, application_id )
USING INDEX app_class_id_pk
);
/
CREATE OR REPLACE VIEW appsec.v_app_class_id AS SELECT * FROM appsec.t_app_class_id;
INSERT INTO appsec.v_app_class_id
(CLASS_NAME, APPLICATION_ID) VALUES
('testojs.TestOracleJavaSecure$AnyNameWeWant','HRVIEW');
 
Search WWH ::




Custom Search