1 DROP VIEW artifactperm_artgrouplist_vw ;
2 DROP VIEW artifactperm_user_vw ;
3 DROP TABLE artifact_perm ;
5 CREATE VIEW artifact_perm AS
8 role_setting.ref_id AS group_artifact_id,
10 role_setting.value::int AS perm_level
11 FROM role_setting, user_group
12 WHERE user_group.role_id = role_setting.role_id
13 AND role_setting.section_name='tracker';
15 CREATE VIEW artifactperm_artgrouplist_vw AS
17 agl.group_artifact_id, agl.name, agl.description,
18 agl.group_id, ap.user_id, ap.perm_level
19 FROM artifact_perm ap, artifact_group_list agl
20 WHERE (ap.group_artifact_id = agl.group_artifact_id) ;
22 CREATE VIEW artifactperm_user_vw AS
24 ap.id, ap.group_artifact_id, ap.user_id, ap.perm_level,
25 users.user_name, users.realname
26 FROM artifact_perm ap, users
27 WHERE (users.user_id = ap.user_id) ;