head	1.8;
access;
symbols;
locks; strict;
comment	@# @;


1.8
date	2001.07.30.18.44.24;	author leonardr;	state dead;
branches;
next	1.7;

1.7
date	2001.07.05.22.21.39;	author leonardr;	state Exp;
branches;
next	1.6;

1.6
date	2001.07.02.18.56.43;	author leonardr;	state Exp;
branches;
next	1.5;

1.5
date	2001.06.29.00.57.49;	author leonardr;	state Exp;
branches;
next	1.4;

1.4
date	2001.06.18.23.41.26;	author leonardr;	state Exp;
branches;
next	1.3;

1.3
date	2001.06.04.19.58.06;	author leonardr;	state Exp;
branches;
next	1.2;

1.2
date	2001.06.04.19.53.22;	author leonardr;	state Exp;
branches;
next	1.1;

1.1
date	2001.05.02.21.21.11;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.8
log
@Moved stuff from 1.1.0 migration directory to 1.2.0 directory to reflect actual future versioning.
@
text
@insert into HELM_ROLE_ACTION_RESOURCE (ROLE_ID, ACTION_ID, RESOURCE_ID)
    select HELM_ROLE.ROLE_ID, HELM_ACTION.ACTION_ID,
           HELM_RESOURCE.RESOURCE_ID
      from HELM_ROLE, HELM_ACTION, HELM_RESOURCE
     where HELM_ROLE.NAME = "Registered User"
       and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
       and HELM_ACTION.NAME in ( "Project Issue Tracking - Submit" )
;

########################################################################

#Roles which get new actions depending on whether they have other
#actions.

drop table if exists xxxx_ROLES_WITH_ACTION;
create table xxxx_ROLES_WITH_ACTION  
(
    ROLE_ID		INTEGER NOT NULL,
    RESOURCE_ID         INTEGER NOT NULL
);

#"ProjectGroup - Edit" -> "Project - Edit"
insert into xxxx_ROLES_WITH_ACTION 
 select ROLE_ID, RESOURCE_ID from HELM_ROLE_ACTION_RESOURCE, HELM_ACTION 
 where HELM_ACTION.ACTION_ID=HELM_ROLE_ACTION_RESOURCE.ACTION_ID 
  and HELM_ACTION.NAME="ProjectGroup - Edit";

insert into HELM_ROLE_ACTION_RESOURCE
 select xxxx_ROLES_WITH_ACTION.ROLE_ID, HELM_ACTION.ACTION_ID, 
	xxxx_ROLES_WITH_ACTION.RESOURCE_ID
 from xxxx_ROLES_WITH_ACTION, HELM_ACTION
 where HELM_ACTION.NAME="Project - Edit"
;

#"VersionControl - Checkout" augmented by "VersionControl - Blame"
insert into xxxx_ROLES_WITH_ACTION 
 select ROLE_ID, RESOURCE_ID from HELM_ROLE_ACTION_RESOURCE, HELM_ACTION 
 where HELM_ACTION.ACTION_ID=HELM_ROLE_ACTION_RESOURCE.ACTION_ID 
  and HELM_ACTION.NAME="ProjectGroup - Delete";

insert into HELM_ROLE_ACTION_RESOURCE
 select xxxx_ROLES_WITH_ACTION.ROLE_ID, HELM_ACTION.ACTION_ID, 
	xxxx_ROLES_WITH_ACTION.RESOURCE_ID
 from xxxx_ROLES_WITH_ACTION, HELM_ACTION
 where HELM_ACTION.NAME="VersionControl - Checkout"
;

#"ProjectGroup - Delete" -> "Project - Delete"
insert into xxxx_ROLES_WITH_ACTION 
 select ROLE_ID, RESOURCE_ID from HELM_ROLE_ACTION_RESOURCE, HELM_ACTION 
 where HELM_ACTION.ACTION_ID=HELM_ROLE_ACTION_RESOURCE.ACTION_ID 
  and HELM_ACTION.NAME="ProjectGroup - Delete";

insert into HELM_ROLE_ACTION_RESOURCE
 select xxxx_ROLES_WITH_ACTION.ROLE_ID, HELM_ACTION.ACTION_ID, 
	xxxx_ROLES_WITH_ACTION.RESOURCE_ID
 from xxxx_ROLES_WITH_ACTION, HELM_ACTION
 where HELM_ACTION.NAME="Project - Delete"
;


#"ProjectGroup - View" -> "Project - View"
insert into xxxx_ROLES_WITH_ACTION 
 select ROLE_ID, RESOURCE_ID from HELM_ROLE_ACTION_RESOURCE, HELM_ACTION 
 where HELM_ACTION.ACTION_ID=HELM_ROLE_ACTION_RESOURCE.ACTION_ID 
  and HELM_ACTION.NAME="ProjectGroup - View";

insert into HELM_ROLE_ACTION_RESOURCE
 select xxxx_ROLES_WITH_ACTION.ROLE_ID, HELM_ACTION.ACTION_ID, 
	xxxx_ROLES_WITH_ACTION.RESOURCE_ID
 from xxxx_ROLES_WITH_ACTION, HELM_ACTION
 where HELM_ACTION.NAME="Project - View"
;

#"ProjectGroup - Element {Add, Delete}" -> "Project - Associate Project"
insert into xxxx_ROLES_WITH_ACTION 
 select ROLE_ID, RESOURCE_ID from HELM_ROLE_ACTION_RESOURCE, HELM_ACTION 
 where HELM_ACTION.ACTION_ID=HELM_ROLE_ACTION_RESOURCE.ACTION_ID 
  and HELM_ACTION.NAME in ("ProjectGroup - Element Add", 
	              "ProjectGroup - Element Delete");

insert into HELM_ROLE_ACTION_RESOURCE
 select xxxx_ROLES_WITH_ACTION.ROLE_ID, HELM_ACTION.ACTION_ID, 
	xxxx_ROLES_WITH_ACTION.RESOURCE_ID
 from xxxx_ROLES_WITH_ACTION, HELM_ACTION
 where HELM_ACTION.NAME="Project - Associate Project"
;

#"ProjectGroup - Add" augmented by "Category - Add"
insert into xxxx_ROLES_WITH_ACTION 
 select ROLE_ID, RESOURCE_ID from HELM_ROLE_ACTION_RESOURCE, HELM_ACTION 
 where HELM_ACTION.ACTION_ID=HELM_ROLE_ACTION_RESOURCE.ACTION_ID 
  and HELM_ACTION.NAME in ("ProjectGroup - Add")
;

insert into HELM_ROLE_ACTION_RESOURCE
 select xxxx_ROLES_WITH_ACTION.ROLE_ID, HELM_ACTION.ACTION_ID, 
	xxxx_ROLES_WITH_ACTION.RESOURCE_ID
 from xxxx_ROLES_WITH_ACTION, HELM_ACTION
 where HELM_ACTION.NAME="Category - Add"
;

drop table xxxx_ROLES_WITH_ACTION;

########################################################################
#Owner roles get specific new actions.

drop table if exists xxxx_OWNER_ROLES;
create table xxxx_OWNER_ROLES 
(
    ROLE_ID		INTEGER NOT NULL,
    TYPE                VARCHAR(7) NOT NULL
);

insert into xxxx_OWNER_ROLES select HELM_ROLE.ROLE_ID, HELM_ROLE.TYPE
 from HELM_ROLE, HELM_ATTRIBUTE, HELM_ATTRIBUTE_VALUE
 where HELM_ROLE.ROLE_ID = HELM_ATTRIBUTE_VALUE.ENTITY_ID 
 and HELM_ATTRIBUTE.ENTITY_TYPE="Role" 
 and HELM_ATTRIBUTE.NAME="denotesOwnership" 
 and HELM_ATTRIBUTE_VALUE.ATTRIBUTE_ID = HELM_ATTRIBUTE.ATTRIBUTE_ID
 and HELM_ATTRIBUTE_VALUE.VALUE="Y"
;

insert into HELM_ROLE_ACTION_RESOURCE select ROLE_ID, ACTION_ID, 1 
 from xxxx_OWNER_ROLES, HELM_ACTION
 where xxxx_OWNER_ROLES.TYPE in ("Project")
 and HELM_ACTION.NAME in ("Project Role - Add"
                        , "Project Role - Edit"
                        , "Project Role - Delete"
                        , "Resource - Add"
                        , "Resource - Edit")                      

insert into HELM_ROLE_ACTION_RESOURCE select ROLE_ID, ACTION_ID, 1 
 from xxxx_OWNER_ROLES, HELM_ACTION
 where xxxx_OWNER_ROLES.TYPE in ("Host", "Domain", "Project")
 and HELM_ACTION.NAME in ("Project - Associate With Project"
                        , "Project - Designate Subproject"
                        , "Project - Designate Superproject");

insert into HELM_ROLE_ACTION_RESOURCE select ROLE_ID, ACTION_ID, 1 
 from xxxx_OWNER_ROLES, HELM_ACTION
 where xxxx_OWNER_ROLES.TYPE in ("Host", "Domain")
 and HELM_ACTION.NAME in ("Category - Add"
                        , "Licenses - Administer"
                        , "Project - Associate Project");

drop table xxxx_OWNER_ROLES;@


1.7
log
@Licenses are now contained in a database-managed table rather than in a custom Java class (yay!)
@
text
@@


1.6
log
@Implemented project-scoped roles.
@
text
@d144 1
@


1.5
log
@Implemented basic project group and category nesting.
@
text
@d126 9
@


1.4
log
@Added project migration and fixed typo in RAR migration. There is an error in this migration suite having to do with a nonexistant CREATED_DATE column in HELM_PROJECTDOCUMENT which I don't know how to deal with; Elicia, can you handle it?
@
text
@d5 1
a5 1
     where HELM_ROLE.NAME = "Anonymous Guest"
d7 87
a93 2
       and HELM_ACTION.NAME in ( "VersionControl - Blame"
                               )
d96 5
a100 9
insert into HELM_ROLE_ACTION_RESOURCE (ROLE_ID, ACTION_ID, RESOURCE_ID)
    select HELM_ROLE.ROLE_ID, HELM_ACTION.ACTION_ID,
           HELM_RESOURCE.RESOURCE_ID
      from HELM_ROLE, HELM_ACTION, HELM_RESOURCE
     where HELM_ROLE.NAME = "Registered User"
       and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
       and HELM_ACTION.NAME in ( "VersionControl - Blame",
                                 "Project Issue Tracking - Submit"
                               )
d103 4
d108 14
a121 8
insert into HELM_ROLE_ACTION_RESOURCE (ROLE_ID, ACTION_ID, RESOURCE_ID)
    select HELM_ROLE.ROLE_ID, HELM_ACTION.ACTION_ID,
           HELM_RESOURCE.RESOURCE_ID
      from HELM_ROLE, HELM_ACTION, HELM_RESOURCE
     where HELM_ROLE.NAME = "Observer"
       and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
       and HELM_ACTION.NAME in ("VersionControl - Blame"
                               )
d123 15
@


1.3
log
@Well, not quite so generously.
@
text
@d18 1
a18 1
                                 "Project Issue Tracking - Submit",
@


1.2
log
@Dispense issue tracking permissions more generously.
@
text
@a18 1
                                 "Project Issue Tracking - Change",
d29 1
a29 2
       and HELM_ACTION.NAME in ("VersionControl - Blame",
                                "Project Issue Tracking - Change",
@


1.1
log
@Adds mapping for 'VersionControl - Blame' action.
@
text
@d17 3
a19 1
       and HELM_ACTION.NAME in ( "VersionControl - Blame"
d30 2
a31 1
       and HELM_ACTION.NAME in ( "VersionControl - Blame"
@

