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exp;
branches;
next	1.17;

1.17
date	2001.06.18.22.12.21;	author leonardr;	state Exp;
branches;
next	1.16;

1.16
date	2001.05.11.19.38.56;	author leonardr;	state Exp;
branches;
next	1.15;

1.15
date	2001.04.06.01.18.19;	author leonardr;	state Exp;
branches;
next	1.14;

1.14
date	2001.02.24.00.08.12;	author leonardr;	state Exp;
branches
	1.14.2.1;
next	1.13;

1.13
date	2001.02.24.00.06.45;	author leonardr;	state Exp;
branches;
next	1.12;

1.12
date	2001.02.21.01.08.28;	author dlr;	state Exp;
branches;
next	1.11;

1.11
date	2001.01.18.21.44.51;	author jrobbins;	state Exp;
branches
	1.11.4.1;
next	1.10;

1.10
date	2001.01.18.18.04.22;	author jrobbins;	state Exp;
branches;
next	1.9;

1.9
date	2001.01.08.20.21.56;	author dlr;	state Exp;
branches;
next	1.8;

1.8
date	2000.12.03.19.27.33;	author edk;	state Exp;
branches;
next	1.7;

1.7
date	2000.12.01.01.54.05;	author elicia;	state Exp;
branches;
next	1.6;

1.6
date	2000.11.22.02.05.29;	author edk;	state Exp;
branches;
next	1.5;

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

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

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

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

1.1
date	2000.11.12.21.17.57;	author dlr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.17.57;	author dlr;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2001.02.21.00.36.30;	author dlr;	state Exp;
branches;
next	;

1.11.4.1
date	2001.01.31.17.47.04;	author leonardr;	state Exp;
branches;
next	;

1.14.2.1
date	2001.04.06.01.28.41;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.18
log
@Implemented project-scoped roles.
@
text
@
####################################################
##
## Create a temp table to hold the non-keyed values
##
##

drop table if exists xxxx_populate_UserRoleProject;
create table xxxx_populate_UserRoleProject
(
        USER_LOGIN    varchar(32) NOT NULL,
        ROLE_NAME     varchar(99) NOT NULL,
        PROJECT_NAME  varchar(64) NOT NULL,
        APPROVED_BY   varchar(32)
);


#Roles in the host and domain projects.
insert into xxxx_populate_UserRoleProject (USER_LOGIN, ROLE_NAME, PROJECT_NAME, APPROVED_BY)
       values 
              ("root", "Host Admin",          "host", "root")
	    , ("**Host Users", "Registered User", "host", "root")
            , ("root", "Click-through Viewer","domain", "root")
            , ("*Domain Users", "Registered User", "domain", "root")
            , ("guest", "Anonymous Guest", "domain", "root")
            , ("guest", "Click-through Viewer", "domain", "root")
;

insert into HELM_USER_ROLE_PROJECT (USER_ID, ROLE_ID, PROJECT_ID, APPROVED_BY)
       select distinct User.USER_ID, Role.ROLE_ID, Project.PROJECT_ID, Approved.USER_ID
         from xxxx_populate_UserRoleProject as Tmp,
              HELM_USER as User,
              HELM_ROLE as Role,
              HELM_PROJECT as Project,
              HELM_USER as Approved
        where Tmp.USER_LOGIN   = User.LOGIN_NAME
          and Tmp.ROLE_NAME    = Role.NAME
          and Tmp.PROJECT_NAME = Project.TYPE
          and Tmp.APPROVED_BY  = Approved.LOGIN_NAME
;

#Roles in named projects.
insert into xxxx_populate_UserRoleProject (USER_LOGIN, ROLE_NAME, PROJECT_NAME, APPROVED_BY)
       values 
	      ("**Host Users", "Content Viewer",  "www", "root")
	    , ("*Domain Users", "Content Viewer", "www", "root")
            , ("root", "Project Owner",           "www", "root")
            , ("webmaster", "Project Owner",      "www", "root")
            , ("guest", "Content Viewer",         "www", "root")
            , ("root", "Project Owner",           "look", "root")
            , ("webmaster", "Project Owner",      "look", "root")
;

##
## now insert the values into the correct table replacing
## names with ids from the corresponding tables
##

# when APPROVED_BY = NULL
insert into HELM_USER_ROLE_PROJECT (USER_ID, ROLE_ID, PROJECT_ID, APPROVED_BY)
       select distinct User.USER_ID, Role.ROLE_ID, Project.PROJECT_ID, NULL
         from xxxx_populate_UserRoleProject as Tmp,
              HELM_USER as User,
              HELM_ROLE as Role,
              HELM_PROJECT as Project,
              HELM_USER as Approved
        where Tmp.USER_LOGIN   = User.LOGIN_NAME
          and Tmp.ROLE_NAME    = Role.NAME
          and Tmp.PROJECT_NAME = Project.NAME
          and ISNULL( Tmp.APPROVED_BY )
;

insert into HELM_USER_ROLE_PROJECT (USER_ID, ROLE_ID, PROJECT_ID, APPROVED_BY)
       select distinct User.USER_ID, Role.ROLE_ID, Project.PROJECT_ID, Approved.USER_ID
         from xxxx_populate_UserRoleProject as Tmp,
              HELM_USER as User,
              HELM_ROLE as Role,
              HELM_PROJECT as Project,
              HELM_USER as Approved
        where Tmp.USER_LOGIN   = User.LOGIN_NAME
          and Tmp.ROLE_NAME    = Role.NAME
          and Tmp.PROJECT_NAME = Project.NAME
          and Tmp.APPROVED_BY  = Approved.LOGIN_NAME
;

drop table if exists xxxx_populate_UserRoleProject;






@


1.17
log
@Huge patch of the day: Got rid of redundant HELM_DOMAIN table. The project representation of the domain and the host is now the canonical one. Host and Domain now subclass ProjectGroup. The canonical representation of a project's membership in a domain group is now the corresponding mapping in HELM_PROJECT_PROJECTGROUP. Schema changes: No more HELM_DOMAIN table (obviously); no more DOMAIN_ID in HELM_PROJECT; HELM_USER and HELM_VC_VIEW now have foreign keys in HELM_PROJECT instead of HELM_DOMAIN.
@
text
@d18 1
d21 25
a45 15
#Root is host admin and co-owner of system projects.
              ("root", "Host Admin",          "**HOST", "root")
            , ("root", "Click-through Viewer","sc-dev2.sp.collab.net", "root")
            , ("root", "Project Owner",       "www", "root")
            , ("root", "Project Owner",       "look", "root")

#Webmaster is co-owner of system projects.
            , ("webmaster", "Project Owner",  "www", "root")
            , ("webmaster", "Project Owner",  "look", "root")

#All registered users get the "Registered User" role. They also get the
#"Content Viewer" role in the www project.
	    , ("**Host Users", "Registered User", "**HOST", "root")
	    , ("**Host Users", "Content Viewer", "www", "root")
            , ("*Domain Users", "Registered User", "sc-dev2.sp.collab.net", "root")
d47 5
a51 5

#Guest has the special guest role.
            , ("guest", "Anonymous Guest", "sc-dev2.sp.collab.net", "root")
            , ("guest", "Click-through Viewer", "sc-dev2.sp.collab.net", "root")
            , ("guest", "Content Viewer",       "www", "root")
d86 1
a86 1
#drop table if exists xxxx_populate_UserRoleProject;
@


1.16
log
@A Heartbreaking Patch of Staggering Genius: adds capacity (but no interface) for deeply nested projects, categories, and project groups. As a side effect, gets rid of the hacky special 'all public projects in domain' group. There are probably bugs in this, and some of those bugs are probably security holes, so watch out.
@
text
@d17 1
d20 9
d32 3
a34 1
	      ("*Domain Users", "Registered User", "*All projects in domain", "root")
d36 4
a39 4
	    , ("**Host Users", "Registered User", "**All projects on host", "root")
	    , ("**Host Users", "Content Viewer", "www", "root")
            , ("guest", "Anonymous Guest",          "*All projects in domain", "root")
            , ("guest", "Click-through Viewer", "*All projects in domain", "root")
a40 9

#Root is Host admin.
            , ("root", "Host Admin",          "**All projects on host", "root")
            , ("root", "Project Owner",       "www", "root")
            , ("root", "Click-through Viewer","**All projects on host", "root")
            , ("root", "Project Owner",       "look", "root")

            , ("webmaster", "Project Owner",  "www", "root")
            , ("webmaster", "Project Owner",  "look", "root")
d75 1
a75 1
drop table if exists xxxx_populate_UserRoleProject;
@


1.15
log
@Guest needs to have Content Viewer role on the www project.
@
text
@d22 1
a22 1
	      ("*Domain Users", "Registered User", "*All public projects in domain", "root")
d26 2
a27 2
            , ("guest", "Anonymous Guest",          "*All public projects in domain", "root")
            , ("guest", "Click-through Viewer",          "*All projects in domain", "root")
@


1.14
log
@Corrected typo and spacing.
@
text
@d28 1
@


1.14.2.1
log
@Merged in leonardr bug fix from HEAD:

Guest needs to have Content Viewer role on the www project.
@
text
@a27 1
            , ("guest", "Content Viewer",       "www", "root")
@


1.13
log
@Give the superuser click-through view permission automatically.
@
text
@d30 4
a33 4
            , ("root", "Host Admin",         "**All projects on host", "root")
            , ("root", "Project Owner",             "www", "root")
            , ("root", "Click-through Viewer",          "*All projects on host", "root")
            , ("root", "Project Owner",             "look", "root")
d35 2
a36 2
            , ("webmaster", "Project Owner",        "www", "root")
            , ("webmaster", "Project Owner",        "look", "root")
@


1.12
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d32 3
a35 1
            , ("root", "Project Owner",             "look", "root")
@


1.11
log
@tets roles will only be in testinst
@
text
@d44 1
a44 1
       select distinct User.userID, Role.roleID, Project.PROJECT_ID, NULL
d46 2
a47 2
              User,
              Role,
d49 3
a51 3
              User as Approved
        where Tmp.USER_LOGIN   = User.loginID
          and Tmp.ROLE_NAME    = Role.name
d57 1
a57 1
       select distinct User.userID, Role.roleID, Project.PROJECT_ID, Approved.userID
d59 2
a60 2
              User,
              Role,
d62 3
a64 3
              User as Approved
        where Tmp.USER_LOGIN   = User.loginID
          and Tmp.ROLE_NAME    = Role.name
d66 1
a66 1
          and Tmp.APPROVED_BY  = Approved.loginID
@


1.11.4.1
log
@correctly capitalized autoIncrement
@
text
@d44 1
a44 1
       select distinct User.USER_ID, Role.ROLE_ID, Project.PROJECT_ID, NULL
d46 2
a47 2
              HELM_USER as User,
              HELM_ROLE as Role,
d49 3
a51 3
              HELM_USER as Approved
        where Tmp.USER_LOGIN   = User.LOGIN_NAME
          and Tmp.ROLE_NAME    = Role.NAME
d57 1
a57 1
       select distinct User.USER_ID, Role.ROLE_ID, Project.PROJECT_ID, Approved.USER_ID
d59 2
a60 2
              HELM_USER as User,
              HELM_ROLE as Role,
d62 3
a64 3
              HELM_USER as Approved
        where Tmp.USER_LOGIN   = User.LOGIN_NAME
          and Tmp.ROLE_NAME    = Role.NAME
d66 1
a66 1
          and Tmp.APPROVED_BY  = Approved.LOGIN_NAME
@


1.10
log
@added guest roles
@
text
@a34 10
            , ("testhostadmin", "Host Admin",  "**All projects on host", "root")
            , ("testdomadmin", "Domain Admin", "*All projects in domain", "root")
            , ("testreguser", "Observer",           "testproject", "**Nobody")
            , ("testobserver", "Observer",          "testproject", "root")
            , ("testobserver", "Developer",         "testproject", "**Nobody")
            , ("testowner",    "Project Owner",     "testproject", "root")
            , ("testcodedev",  "Code Developer",    "testproject", "root")
            , ("testcontdev",  "Content Developer", "testproject", "root")
            , ("testdev",      "Developer",         "testproject", "root")
            , ("testdev",      "Project Owner",     "testproject", "**Nobody")
@


1.9
log
@Added guest user.
@
text
@d26 2
a31 1
            , ("guest", "Observer",          "**All projects on host", "root")
@


1.8
log
@* create look project (needed since site admin needs to be able to control
  access to it to change branding)
* add admin@@{domain} ( or admin@@www.{domain} ) mailing list
* change all default addresses to admin@@{domain}
* add webmaster, postmaster, and mailer-daemon addresses
@
text
@d28 1
a28 1
            , ("root", "Host Admin",       "**All projects on host", "root")
d30 1
@


1.7
log
@gave root user a role of Project Owner on project www, for request that www should show up in root's My Projects list
@
text
@d29 4
a32 1
            , ("root", "Project Owner",       "www", "root")
@


1.6
log
@* remove potential developer role so that people can't make role requests
  for private projects unless they have invitations.
* added a timestamp field and an index to INVITATION
@
text
@d29 1
@


1.5
log
@Added requestable field to Role. Created a new role with role request permission, and granted it to everybody across all projects (even proprietary ones)
@
text
@a22 1
	    , ("*Domain Users", "Potential Developer", "*All projects in domain", "root")
a25 1
	    , ("**Host Users", "Potential Developer", "*All projects on host", "root")
@


1.4
log
@Give everyone Content Viewer role in the www project so they can view domain web pages.
@
text
@d23 1
d27 1
@


1.3
log
@Fixed role assignment again.
@
text
@d20 2
a21 1
#All registered users get the "Registered User" role.
d23 1
d25 1
@


1.2
log
@Corrected test user names in role assignment.
@
text
@d26 2
a27 2
            , ("testhostadmin", "Test Host Admin",  "**All projects on host", "root")
            , ("testdomadmin", "Test Domain Admin", "**All projects in domain", "root")
@


1.1
log
@Initial revision
@
text
@d26 2
a27 3

            , ("testhostadmin", "Host Admin",  "**All projects on host", "root")
            , ("testdomadmin", "Domain Admin", "**All projects in domain", "root")
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@@


1.1.1.2
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d20 1
a20 2
#All registered users get the "Registered User" role. They also get the
#"Content Viewer" role in the www project.
a21 1
	    , ("*Domain Users", "Content Viewer", "www", "root")
a22 3
	    , ("**Host Users", "Content Viewer", "www", "root")
            , ("guest", "Anonymous Guest",          "*All public projects in domain", "root")
            , ("guest", "Click-through Viewer",          "*All projects in domain", "root")
d25 12
a36 5
            , ("root", "Host Admin",         "**All projects on host", "root")
            , ("root", "Project Owner",             "www", "root")
            , ("webmaster", "Project Owner",        "www", "root")
            , ("root", "Project Owner",             "look", "root")
            , ("webmaster", "Project Owner",        "look", "root")
d46 1
a46 1
       select distinct User.USER_ID, Role.ROLE_ID, Project.PROJECT_ID, NULL
d48 2
a49 2
              HELM_USER as User,
              HELM_ROLE as Role,
d51 3
a53 3
              HELM_USER as Approved
        where Tmp.USER_LOGIN   = User.LOGIN_NAME
          and Tmp.ROLE_NAME    = Role.NAME
d59 1
a59 1
       select distinct User.USER_ID, Role.ROLE_ID, Project.PROJECT_ID, Approved.USER_ID
d61 2
a62 2
              HELM_USER as User,
              HELM_ROLE as Role,
d64 3
a66 3
              HELM_USER as Approved
        where Tmp.USER_LOGIN   = User.LOGIN_NAME
          and Tmp.ROLE_NAME    = Role.NAME
d68 1
a68 1
          and Tmp.APPROVED_BY  = Approved.LOGIN_NAME
@

