head	1.2;
access;
symbols
	TIGRIS_1_1_0RC2:1.2
	TIGRIS_1_1_0RC1:1.2
	TIGRIS_1_1:1.2.0.4
	TIGRIS_1_0_8:1.2
	TIGRIS_1_0_8RC3:1.2
	TIGRIS_1_0_8RC2:1.2
	TIGRIS_1_0_8RC1:1.2
	TIGRIS_1_0_7:1.2
	TIGRIS_1_0_7RC3:1.2
	TIGRIS_1_0_7RC2:1.2
	TIGRIS_1_0_7RC1:1.2
	TIGRIS_1_0_6:1.2
	TIGRIS_1_0_6RC5:1.2
	TIGRIS_1_0_6RC4:1.2
	TIGRIS_1_0_6RC3:1.2
	TIGRIS_1_0_6RC2:1.2
	TIGRIS_1_0_6RC1:1.2
	TIGRIS_1_0_5:1.2
	TIGRIS_1_0_5RC6:1.2
	TIGRIS_1_0_5RC5:1.2
	TIGRIS_1_0_5RC4:1.2
	TIGRIS_1_0_5RC3:1.2
	TIGRIS_1_0_5RC2:1.2
	TIGRIS_1_0_5RC1:1.2
	TIGRIS_1_0_4:1.2
	TIGRIS_1_0_3:1.2
	TIGRIS_1_0_2:1.2
	TIGRIS_1_0_1:1.2
	TIGRIS_1_0:1.2.0.6
	TIGRIS_1_0_0:1.2
	TIGRIS_1_0_0_RC1:1.2.0.2;
locks; strict;
comment	@# @;


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

1.1
date	2001.03.17.07.50.48;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.2
log
@BroadcastMessage now requires Domain - Administrate, and there are now roles that actually have that permission.
@
text
@# create a temporary table.

drop table if exists xxxx_populate_RoleActionResource;
create table xxxx_populate_RoleActionResource  (
    ROLE_ID		integer NOT NULL,
    ACTION_ID	        integer NOT NULL,
    RESOURCE_ID	        integer NOT NULL
);

#
# click-through viewer role - domain-wide
#
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 = "Click-through Viewer"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ("Click-through Page - Seen")
;

#
# anonymous guest role - domain-wide
#
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 = "Anonymous Guest"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ( "Domain Page - View"
                                   , "Domain News - View"
                                   , "Domain - Join"
                                   , "DomainProjects - View"
                                   , "DomainProjectCategories - View"
                                   , "DomainSpotlight - View"
                                   , "Project Content - View"
                                   , "Project Download - View"
                                   , "Project Document - View"
		                   , "Project Issue Tracking - Query"
                                   , "Project Member - List"
                                   , "Project News - View"
                                   , "Project Page - View"
                                   , "SearchResults - View"
	                           , "Mailing List - List"
                                   , "Mailing List - View"
				   , "VersionControl - Update"
				   , "VersionControl - Diff"
				   , "VersionControl - Logs"
				   , "VersionControl - History"
				   )
;

#
# registered user role - domain-wide
#
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 ( "Domain Page - View"
                                   , "Domain News - View"
                                   , "DomainProjects - View"
                                   , "DomainProjectCategories - View"
                                   , "DomainSpotlight - View"
                                   , "Project - Suggest" 
   		                   , "Project - View"	
                                   , "Project - Volunteer"
                                   , "Project Content - View"
                                   , "Project Download - View"
                                   , "Project Document - View"
		                   , "Project Issue Tracking - Query"
                                   , "Project Member - List"
                                   , "Project News - View"
                                   , "Project Page - View"
                                   , "Project Role - Request"
                                   , "Project Screenshot - Suggest"
                                   , "SearchResults - View"
                                   , "Start Page - View"
                                   , "User - Edit - Self"
				   , "User - View - Self"
	                           , "Mailing List - List"
                                   , "Mailing List - View"
				   , "VersionControl - Update"
				   , "VersionControl - Diff"
				   , "VersionControl - Logs"
				   , "VersionControl - History"
				   )
;

#
# content viewer role - project-specific
#
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 = "Content Viewer"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ("Project Content - View"
	                           ,"Project Download - View"
                               ,"Project Document - View")
;

#
# observer role - associated w/project.
#

# Observer has all permissions of registered user. (?)
insert into xxxx_populate_RoleActionResource
	       select  ToRole.ROLE_ID, ToCopy.ACTION_ID, ToCopy.RESOURCE_ID
         from  HELM_ROLE as FromRole, HELM_ROLE as ToRole, 
               HELM_ROLE_ACTION_RESOURCE as ToCopy
         where ToCopy.ROLE_ID = FromRole.ROLE_ID
	   and FromRole.NAME = "Registered User"
	   and ToRole.NAME = "Observer"
;
insert into HELM_ROLE_ACTION_RESOURCE 
	select * from xxxx_populate_RoleActionResource;
delete from xxxx_populate_RoleActionResource;

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 ( 
	                               "Mailing List - List"
                                     , "Mailing List - View"
		                     , "Project Issue Tracking - Submit"
                                     , "Project Document - Suggest"
                                     , "Project Download - Suggest"
                                     , "Project News - Suggest"
				     , "Project Role - Revoke - Self"
				     , "VersionControl - Update"
				     , "VersionControl - Diff"
				     , "VersionControl - Logs"
				     , "VersionControl - History"
				     , "Proprietary Content - Access"
				     , "Private Mailing List - View"
				   )
;

#
# developer role - associated w/project
#

# Developer and content developer have all permissions of observer.
insert into xxxx_populate_RoleActionResource
       select  ToRole.ROLE_ID, ToCopy.ACTION_ID, ToCopy.RESOURCE_ID
         from  HELM_ROLE as FromRole, HELM_ROLE as ToRole, 
               HELM_ROLE_ACTION_RESOURCE as ToCopy
         where ToCopy.ROLE_ID = FromRole.ROLE_ID
	   and FromRole.NAME = "Observer"
	   and (ToRole.NAME = "Developer" or ToRole.NAME = "Content Developer")
;
insert into HELM_ROLE_ACTION_RESOURCE
	select * from xxxx_populate_RoleActionResource
;
delete from xxxx_populate_RoleActionResource;

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 = "Developer"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ( 
                                     "Project Branding - View"
	                           , "Project Issue Tracking - Change"
                                   , "Project Member - List"
                                   , "VersionControl - Add"
                                   , "VersionControl - Commit"
                                   , "VersionControl - Import"
                                   , "VersionControl - Remove"
                                   , "VersionControl - Status"
                                   , "VersionControl - Tag"
                                   )
;

#
# content developer role - associated w/project
#

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 = "Content Developer"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ( "Project Branding - View"
                                   , "Project Member - List"
                                   )
;

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 = "Content Developer"
           and HELM_RESOURCE.DESCRIPTION in ("All web pages")
           and HELM_ACTION.NAME in ( "VersionControl - Add"
                                   , "VersionControl - Commit"
                                   , "VersionControl - Import"
                                   , "VersionControl - Remove"
                                   , "VersionControl - Status"
                                   , "VersionControl - Tag"
                                   )
;

#
# project owner role - associated w/project
#

# Project owner has all permissions of developer 
insert into xxxx_populate_RoleActionResource
       select  ToRole.ROLE_ID, ToCopy.ACTION_ID, ToCopy.RESOURCE_ID
         from  HELM_ROLE as FromRole, HELM_ROLE as ToRole, 
               HELM_ROLE_ACTION_RESOURCE as ToCopy
         where ToCopy.ROLE_ID = FromRole.ROLE_ID
	   and FromRole.NAME = "Developer" 
	   and ToRole.NAME = "Project Owner"
;
insert into HELM_ROLE_ACTION_RESOURCE
	select * from xxxx_populate_RoleActionResource
;
delete from xxxx_populate_RoleActionResource;

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 = "Project Owner"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ( 
                                     "Mailing List - Add"
                                   , "Mailing List - Delete"
                                   , "Mailing List - Edit"
                                   , "Mailing List - List Members"
                                   , "Mailing List - Subscribe Members"
                                   , "Project - Delete"
                                   , "Project - Edit"
                                   , "Project - Invite"
	                           , "Project - Audit Log - View"
                                   , "Project Branding - Edit"
                                   , "Project Document - Approve"
                                   , "Project Document - Delete"
                                   , "Project Document - Edit"
                                   , "Project Download - Approve"
                                   , "Project Download - Delete"
                                   , "Project Download - Edit"
	                           , "Project Issue Tracking - Configure"
                                   , "Project News - Approve"
                                   , "Project News - Edit"
                                   , "Project News - Delete"
                                   , "Project Page - Edit"
	                           , "Project Role - Grant"
                                   , "Project Screenshot - Approve"
                                   , "Domain News - View"
                                   , "Domain News - Edit"
                                   )
;


#
# domain admin role - global domain
#

# Domain admin has all permissions of project owner.
insert into xxxx_populate_RoleActionResource
       select  ToRole.ROLE_ID, ToCopy.ACTION_ID, ToCopy.RESOURCE_ID
         from  HELM_ROLE as FromRole, HELM_ROLE as ToRole, 
               HELM_ROLE_ACTION_RESOURCE as ToCopy
         where ToCopy.ROLE_ID = FromRole.ROLE_ID
	   and FromRole.NAME = "Project Owner"
	   and ToRole.NAME = "Domain Admin"
;
insert into HELM_ROLE_ACTION_RESOURCE
	select * from xxxx_populate_RoleActionResource
;
delete from xxxx_populate_RoleActionResource;

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 = "Domain Admin"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ( "Domain - Administer"
 		                   , "Domain - Delete"
                                   , "Domain - Edit"
	                           , "Domain - Audit Log - View"
                                   , "Domain - View"
                                   , "Domain Branding - Edit"
                                   , "Domain Page - Edit"
	                           , "Domain Role - Grant"
                                   , "DomainProjectCategories - Edit"
                                   , "DomainSpotlight - Edit"
				   , "ProjectGroup - Add"
				   , "ProjectGroup - Delete"   
				   , "ProjectGroup - Edit"   
				   , "ProjectGroup - List"   
				   , "ProjectGroup - View"
				   , "ProjectGroup Element - Add"
				   , "ProjectGroup Element - Delete"
                                   , "Project - Approve"
	                           , "Project - Lock"
				   , "Project - List"
	    	                   , "Unapproved Project Role - Grant"
				   , "Resource - Add"
				   , "Resource - Edit"
				   , "Project Role - Add"
				   , "Project Role - Edit"
				   , "Project Role - Delete"
				   , "Domain Role - Add"
				   , "Domain Role - Edit"
				   , "Domain Role - Delete"
		                   , "Session - List"
				   , "UserGroup - Add"
				   , "UserGroup - Delete"   
				   , "UserGroup - Edit"   
				   , "UserGroup - List"   
				   , "UserGroup - View"
				   , "UserGroup Element - Add"
				   , "UserGroup Element - Delete"
                                   , "User - Add"
                                   , "User - Delete"
                                   , "User - Edit"
	                           , "User - List"
                                   , "User - View"
                                   , "Domain News - Edit"
                                   , "Domain Role - Grant"
                                   )
;


#
# host admin role
#

# Host admin has all permissions of domain admin.
insert into xxxx_populate_RoleActionResource
       select  ToRole.ROLE_ID, ToCopy.ACTION_ID, ToCopy.RESOURCE_ID
         from  HELM_ROLE as FromRole, HELM_ROLE as ToRole, 
               HELM_ROLE_ACTION_RESOURCE as ToCopy
         where ToCopy.ROLE_ID = FromRole.ROLE_ID
	   and FromRole.NAME = "Domain Admin"
	   and ToRole.NAME = "Host Admin"
;
insert into HELM_ROLE_ACTION_RESOURCE
	select * from xxxx_populate_RoleActionResource
;
delete from xxxx_populate_RoleActionResource;

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 = "Host Admin"
           and HELM_RESOURCE.DESCRIPTION in ("All applicable resources")
           and HELM_ACTION.NAME in ( "Domain - Add"
                                   , "Domain - List"
				   , "Helm - Administer"
	                           , "Host - Audit Log - View"
	                           , "Host Role - Grant"
				   , "Host Role - Add"
				   , "Host Role - Edit"
				   , "Host Role - Delete"
                                   )
;

drop table if exists xxxx_populate_RoleActionResource;
@


1.1
log
@Added scripts to convert from Tigris Classic (tm) to Tigris 1.0.0 (tm). Lovely. A few TODOs: 1) Convert project_mlists into Anzu options. 2) Figure out what to do with the domain_config table. 3) Put in the Eyebrowse tables. 4) Plug in the Bugzilla -> Issuezilla conversion script (yet to be written). That's all for today, I'm going home.
@
text
@d282 2
a283 1
           and HELM_ACTION.NAME in ( "Domain - Delete"
@

