테이블 생성
create table acl_sid(
id bigserial not null primary key,
principal boolean not null,
sid varchar(100) not null,
constraint unique_uk_1 unique(sid,principal));
create table acl_class(
id bigserial not null primary key,
class varchar(100) not null,
constraint unique_uk_2 unique(class));
create table acl_object_identity(
id bigserial primary key,
object_id_class bigint not null,
object_id_identity bigint not null,
parent_object bigint,
owner_sid bigint,
entries_inheriting boolean not null,
constraint unique_uk_3 unique(object_id_class,object_id_identity),
constraint foreign_fk_1 foreign key(parent_object) references acl_object_identity(id),
constraint foreign_fk_2 foreign key(object_id_class) references acl_class(id),
constraint foreign_fk_3 foreign key(owner_sid) references acl_sid(id));
create table acl_entry(
id bigserial primary key,
acl_object_identity bigint not null,
ace_order int not null,
sid bigint not null,
mask integer not null,
granting boolean not null,
audit_success boolean not null,
audit_failure boolean not null,
constraint unique_uk_4 unique(acl_object_identity,ace_order),
constraint foreign_fk_4 foreign key(acl_object_identity)
references acl_object_identity(id),
constraint foreign_fk_5 foreign key(sid) references acl_sid(id));
데이터 등록
INSERT INTO "acl_sid"
(id, principal, sid)
VALUES
(1, True, 'john'),
(2, True, 'jane'),
(3, True, 'mike');
INSERT INTO "acl_class"
("id", "class")
VALUES
(1, 'org.krams.tutorial.domain.AdminPost'),
(2, 'org.krams.tutorial.domain.PersonalPost'),
(3, 'org.krams.tutorial.domain.PublicPost');
INSERT INTO "acl_object_identity"
("id", "object_id_class", "object_id_identity", "parent_object", "owner_sid", "entries_inheriting")
VALUES
(1, 1, 1, NULL, 1, False),
(2, 1, 2, NULL, 1, False),
(3, 1, 3, NULL, 1, False),
(4, 2, 1, NULL, 1, False),
(5, 2, 2, NULL, 1, False),
(6, 2, 3, NULL, 1, False),
(7, 3, 1, NULL, 1, False),
(8, 3, 2, NULL, 1, False),
(9, 3, 3, NULL, 1, False);
INSERT INTO "acl_entry"
("id", "acl_object_identity", "ace_order", "sid", "mask", "granting", "audit_success", "audit_failure")
VALUES
(1, 1, 1, 1, 1, True, True, True),
(2, 2, 1, 1, 1, True, True, True),
(3, 3, 1, 1, 1, True, True, True),
(4, 1, 2, 1, 2, True, True, True),
(5, 2, 2, 1, 2, True, True, True),
(6, 3, 2, 1, 2, True, True, True),
(7, 4, 1, 1, 1, True, True, True),
(8, 5, 1, 1, 1, True, True, True),
(9, 6, 1, 1, 1, True, True, True),
(10, 7, 1, 1, 1, True, True, True),
(11, 8, 1, 1, 1, True, True, True),
(12, 9, 1, 1, 1, True, True, True),
(13, 7, 2, 1, 2, True, True, True),
(14, 8, 2, 1, 2, True, True, True),
(15, 9, 2, 1, 2, True, True, True),
(28, 4, 3, 2, 1, True, True, True),
(29, 5, 3, 2, 1, True, True, True),
(30, 6, 3, 2, 1, True, True, True),
(31, 4, 4, 2, 2, True, True, True),
(32, 5, 4, 2, 2, True, True, True),
(33, 6, 4, 2, 2, True, True, True),
(34, 7, 3, 2, 1, True, True, True),
(35, 8, 3, 2, 1, True, True, True),
(36, 9, 3, 2, 1, True, True, True),
(37, 7, 4, 2, 2, True, True, True),
(38, 8, 4, 2, 2, True, True, True),
(39, 9, 4, 2, 2, True, True, True),
(40, 7, 5, 3, 1, True, True, True),
(41, 8, 5, 3, 1, True, True, True),
(42, 9, 5, 3, 1, True, True, True);
'Java' 카테고리의 다른 글
| Spring Security 3.0 Sample (PostgreSQL) (0) | 2011/10/06 |
|---|---|
| Java에서 DLL 라이브러리 연동관련 (0) | 2011/01/31 |
| Thumbnail(resizing) 생성과 Watermark적용 (0) | 2009/12/28 |
| Log4J (0) | 2009/12/07 |
| log4j와 commons.logging.log[펌] (0) | 2009/12/05 |
| Java File copy type & Perfomance (0) | 2009/12/04 |


