DB2AuthorizationManager
AuthorizationManager implementations are dedicated to the webapp developer. this AuthorizationManager implementation permits an DB2 database-based authorization method.1. DB2AuthorizationManager parameters
The corresponding DTD (jGuardPrincipalsPermissions_x.xx.dtd), must be in the same directory.-
permissionManager
values
net.sf.jguard.authorization.DB2AuthorizationManager
description
this parameter must be placed in the AccessFilter parameters list, in the web.xml file. It refers to the DB2 AuthorizationManager implementation.
example
..... <init-param> <param-name>permissionManager</param-name> <param-value>net.sf.jguard.authorization.DB2AuthorizationManager</param-value> <description>class which handle to collect permissionsCollection</description> </init-param> .....
-
authorizationDriver
values
com.DB2.jdbc.Driver
description
this parameter must be placed in the AccessFilter parameters list, in the web.xml file. It refers to the DB2 implementation of the java.sql.Driver interface.
example
..... <init-param> <param-name>authorizationDriver</param-name> <param-value>com.DB2.jdbc.Driver</param-value> <description>jdbc driver for authorizations</description> </init-param> ....
-
authorizationUrl
values
any JDBC compliant url
description
this parameter permits to establish a database connection.
example
..... <init-param> <param-name>authorizationUrl</param-name> <param-value>jdbc:DB2://mysweethome.net/diabolo</param-value> <description>jdbc url for authorizations</description> </init-param> ....
-
authorizationLogin
values
any value
description
this parameter is the login value used to establish the connection.
example
..... <init-param> <param-name>authorizationLogin</param-name> <param-value>system</param-value> <description>login to establish authorizations connection</description> </init-param> ....
-
authorizationPassword
values
any value
description
this parameter is the password value used to establish the connection.
example
..... <init-param> <param-name>authorizationPassword</param-name> <param-value>manager</param-value> <description>password to establish authorizations connection</description> </init-param> ....
-
debug
values
true or false
description
enable debug information with the true value.
example
..... <init-param> <param-name>debug</param-name> <param-value>false</param-value> <description>enable debug with true to trace authorization settings</description> </init-param> ....
2. SQL installation script
alter table jg_role_permission drop foreign key fk_permission_role; alter table jg_role_permission drop foreign key fk_role_permission; alter table jg_urlquery drop foreign key fk_perm_parameter; alter table jg_permission drop foreign key fk_perm_domain; drop table jg_role_domain; drop table jg_role_permission; drop table jg_urlquery; drop table jg_app_role; drop table jg_permission; drop table jg_domain; create table jg_role_domain ( domain_name varchar(255) not null, role_name varchar(255) not null, primary key (role_name, domain_name) ); create table jg_role_permission ( permission_name varchar(255) not null, role_name varchar(255) not null, primary key (role_name, permission_name) ); create table jg_urlquery ( urlquery_id bigint not null generated by default as identity, parameter varchar(255), value varchar(255), permission_name varchar(255), primary key (urlquery_id) ); create table jg_app_role ( name varchar(255) not null, primary key (name) ); create table jg_domain( name varchar(255) not null, primary key(name) ); create table jg_permission ( name varchar(255) not null, uri varchar(255), description varchar(255), scheme varchar(5), domain_name varchar(255), primary key (name) ); alter table jg_role_permission add constraint fk_permission_role foreign key (role_name) references jg_app_role(name); alter table jg_role_permission add constraint fk_role_permission foreign key (permission_name) references jg_permission(name); alter table jg_role_domain add constraint fk_domain_role foreign key (role_name) references jg_app_role(name); alter table jg_role_domain add constraint fk_role_domain foreign key (domain_name) references jg_domain(name); alter table jg_urlquery add constraint fk_perm_parameter foreign key (permission_name) references jg_permission(name); alter table jg_permission add constraint fk_perm_domain foreign key (domain_name) references jg_domain(name);