From: <id...@us...> - 2008-10-07 13:16:59
|
Revision: 4816 http://openuss.svn.sourceforge.net/openuss/?rev=4816&view=rev Author: idueppe Date: 2008-10-07 13:15:59 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Add checks that all courses, coursetypes, and institutes are registered in security_objectidentifities Modified Paths: -------------- branches/openuss-plexus-3.1/plexus/plexus-core/src/main/data/migration_30RC1_to_31.sql Modified: branches/openuss-plexus-3.1/plexus/plexus-core/src/main/data/migration_30RC1_to_31.sql =================================================================== --- branches/openuss-plexus-3.1/plexus/plexus-core/src/main/data/migration_30RC1_to_31.sql 2008-10-07 13:12:46 UTC (rev 4815) +++ branches/openuss-plexus-3.1/plexus/plexus-core/src/main/data/migration_30RC1_to_31.sql 2008-10-07 13:15:59 UTC (rev 4816) @@ -188,6 +188,8 @@ ALTER TABLE COURSES2GROUPS ADD CONSTRAINT LECTURE_COURSE_GROUPS_FKC FOREIGN KEY (GROUPS_FK) REFERENCES SECURITY_GROUP; ALTER TABLE COURSES2GROUPS ADD CONSTRAINT SECURITY_GROUP_COURSES_FKC FOREIGN KEY (COURSES_FK) REFERENCES LECTURE_COURSE; + + -- adding groups for all courses -- create procedure create_groups @@ -228,6 +230,38 @@ delete from security_permission where security_permission.mask = 1040 and security_permission.acl_object_identity_fk in (select id from lecture_course); + +-- Check that all courses has an object id that represens course -> course_type permission hierarchy +INSERT INTO security_object_identity (ID, PARENT_FK) +SELECT + i.id, null +FROM + lecture_institute i +WHERE + not exists + (SELECT o.id FROM security_object_identity o WHERE o.id = i.id); + +-- Check that all course_type has an object id that represens course_type -> institute permission hierarchy +INSERT INTO security_object_identity (ID, PARENT_FK) +SELECT + ct.id, ct.institute_fk +FROM + lecture_course_type ct +WHERE + not exists + (SELECT o.id FROM security_object_identity o WHERE o.id = ct.id); + +-- check that all courses has an object id that represens course -> course_type permission hierarchy +insert into security_object_identity (id, parent_fk) +select + c.id, c.course_type_fk +from + lecture_course c +where + not exists + (select o.id from security_object_identity o where o.id = c.id); + + -- add read permission to course to group -- create procedure add_coursegroup_permissions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |