]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 478972: Remove the 'useentrygroupdefault' parameter - Patch by Frédéric Buclin...
authorlpsolit%gmail.com <>
Tue, 31 Mar 2009 19:16:13 +0000 (19:16 +0000)
committerlpsolit%gmail.com <>
Tue, 31 Mar 2009 19:16:13 +0000 (19:16 +0000)
Bugzilla/Config.pm
Bugzilla/Config/GroupSecurity.pm
Bugzilla/DB/Schema.pm
Bugzilla/Install/DB.pm
Bugzilla/Product.pm
Bugzilla/User.pm
docs/en/xml/administration.xml
editgroups.cgi
sanitycheck.cgi
template/en/default/admin/params/groupsecurity.html.tmpl

index 14f10bed986be6b104c1321e0bc37640c0bc718a..4074abcd1a4070b967c5851b1f504b90f25a8bff 100644 (file)
@@ -151,10 +151,6 @@ sub update_params {
     {
         $param->{'makeproductgroups'} = $param->{'usebuggroups'};
     }
-    if (exists $param->{'usebuggroupsentry'} 
-       && !exists $param->{'useentrygroupdefault'}) {
-        $param->{'useentrygroupdefault'} = $param->{'usebuggroupsentry'};
-    }
 
     # Modularise auth code
     if (exists $param->{'useLDAP'} && !exists $param->{'loginmethod'}) {
index 0a238f20938e5231254e71585f717565aa0565a9..f0038f153fcfaebd1aa06b3d2b0fc05b70e1b0a3 100644 (file)
@@ -48,12 +48,6 @@ sub get_param_list {
    default => 0
   },
 
-  {
-   name => 'useentrygroupdefault',
-   type => 'b',
-   default => 0
-  },
-
   {
    name => 'chartgroup',
    type => 's',
index 680f754ca8fa179c50f279167cb649370a6a441c..1afdb6598ca1aad57efb2b7bc79b5c530909b8bd 100644 (file)
@@ -1010,10 +1010,12 @@ use constant ABSTRACT_SCHEMA => {
                               REFERENCES => {TABLE  =>  'products',
                                              COLUMN =>  'id',
                                              DELETE =>  'CASCADE'}},
-            entry         => {TYPE => 'BOOLEAN', NOTNULL => 1},
+            entry         => {TYPE => 'BOOLEAN', NOTNULL => 1,
+                              DEFAULT => 'FALSE'},
             membercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1},
             othercontrol  => {TYPE => 'BOOLEAN', NOTNULL => 1},
-            canedit       => {TYPE => 'BOOLEAN', NOTNULL => 1},
+            canedit       => {TYPE => 'BOOLEAN', NOTNULL => 1,
+                              DEFAULT => 'FALSE'},
             editcomponents => {TYPE => 'BOOLEAN', NOTNULL => 1,
                                DEFAULT => 'FALSE'},
             editbugs      => {TYPE => 'BOOLEAN', NOTNULL => 1,
index ec6c8ce9c7dba9a98b1c7115944bcd97a8647e92..de1d48361d863bdc18cf9c77f694b96dbfade04c 100644 (file)
@@ -557,7 +557,13 @@ sub update_table_definitions {
     # 2009-03-02 arbingersys@gmail.com - Bug 423613
     $dbh->bz_add_index('profiles', 'profiles_extern_id_idx',
                        {TYPE => 'UNIQUE', FIELDS => [qw(extern_id)]});
+
+    # 2009-03-31 LpSolit@gmail.com - Bug 478972
+    $dbh->bz_alter_column('group_control_map', 'entry',
+                          {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
+    $dbh->bz_alter_column('group_control_map', 'canedit',
+                          {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
+
     ################################################################
     # New --TABLE-- changes should go *** A B O V E *** this point #
     ################################################################
@@ -1840,7 +1846,6 @@ sub _setup_usebuggroups_backward_compatibility {
     #
     # If group_control_map is empty, backward-compatibility
     # usebuggroups-equivalent records should be created.
-    my $entry = Bugzilla->params->{'useentrygroupdefault'};
     my ($maps_exist) = $dbh->selectrow_array(
         "SELECT DISTINCT 1 FROM group_control_map");
     if (!$maps_exist) {
@@ -1857,11 +1862,9 @@ sub _setup_usebuggroups_backward_compatibility {
             if ($groupname eq $productname) {
                 # Product and group have same name.
                 $dbh->do("INSERT INTO group_control_map " .
-                         "(group_id, product_id, entry, membercontrol, " .
-                         "othercontrol, canedit) " .
-                         "VALUES ($groupid, $productid, $entry, " .
-                         CONTROLMAPDEFAULT . ", " .
-                         CONTROLMAPNA . ", 0)");
+                         "(group_id, product_id, membercontrol, othercontrol) " .
+                         "VALUES (?, ?, ?, ?)", undef,
+                         ($groupid, $productid, CONTROLMAPDEFAULT, CONTROLMAPNA));
             } else {
                 # See if this group is a product group at all.
                 my $sth2 = $dbh->prepare("SELECT id FROM products 
@@ -1872,11 +1875,9 @@ sub _setup_usebuggroups_backward_compatibility {
                     # If there is no product with the same name as this
                     # group, then it is permitted for all products.
                     $dbh->do("INSERT INTO group_control_map " .
-                             "(group_id, product_id, entry, membercontrol, " .
-                             "othercontrol, canedit) " .
-                             "VALUES ($groupid, $productid, 0, " .
-                             CONTROLMAPSHOWN . ", " .
-                             CONTROLMAPNA . ", 0)");
+                             "(group_id, product_id, membercontrol, othercontrol) " .
+                             "VALUES (?, ?, ?, ?)", undef,
+                             ($groupid, $productid, CONTROLMAPSHOWN, CONTROLMAPNA));
                 }
             }
         }
index 88292d27e1af8629cb9508d44ad0106ce83124f6..03ebe26399e22268c60540bb4ba5200dea635530 100644 (file)
@@ -565,10 +565,9 @@ sub _create_bug_group {
 
     # Associate the new group and new product.
     $dbh->do('INSERT INTO group_control_map
-              (group_id, product_id, entry, membercontrol, othercontrol, canedit)
-              VALUES (?, ?, ?, ?, ?, ?)',
-              undef, ($group->id, $self->id, Bugzilla->params->{'useentrygroupdefault'},
-                      CONTROLMAPDEFAULT, CONTROLMAPNA, 0));
+              (group_id, product_id, membercontrol, othercontrol)
+              VALUES (?, ?, ?, ?)',
+              undef, ($group->id, $self->id, CONTROLMAPDEFAULT, CONTROLMAPNA));
 }
 
 sub _create_series {
index fe04856aa600aeb477357b9df39309b06835d6a6..d373f019dad040bae6548414e9653642153c48a7 100644 (file)
@@ -658,13 +658,9 @@ sub get_selectable_products {
         my $query = "SELECT id " .
                     "  FROM products " .
                  "LEFT JOIN group_control_map " .
-                    "    ON group_control_map.product_id = products.id ";
-        if (Bugzilla->params->{'useentrygroupdefault'}) {
-            $query .= " AND group_control_map.entry != 0 ";
-        } else {
-            $query .= " AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY;
-        }
-        $query .= "     AND group_id NOT IN(" . $self->groups_as_string . ") " .
+                        "ON group_control_map.product_id = products.id " .
+                      " AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY .
+                      " AND group_id NOT IN(" . $self->groups_as_string . ") " .
                   "   WHERE group_id IS NULL " .
                   "ORDER BY name";
 
index df56715025c0787b28c01be8cc22004994fdae76..09cf36ed166ab215a20e2dbdcf68ec4a673fd03e 100644 (file)
             </listitem>
           </varlistentry>
 
-          <varlistentry>
-            <term>
-              useentrygroupdefault
-            </term>
-            <listitem>
-              <para>
-                Bugzilla products can have a group associated with them, so that
-                certain users can only see bugs in certain products. When this 
-                parameter is set to <quote>on</quote>, this 
-                causes the initial group controls on newly created products 
-                to place all newly-created bugs in the group 
-                having the same name as the product immediately.
-                After a product is initially created, the group controls
-                can be further adjusted without interference by 
-                this mechanism.
-              </para>
-            </listitem>
-          </varlistentry>
-
           <varlistentry>
             <term>
               usevisibilitygroups
index 475b805cc175c730ca27c3a5a7ffeb42b75c18f8..0554638faf934235735df991a8167c9f4d4621e9 100755 (executable)
@@ -214,9 +214,8 @@ if ($action eq 'new') {
     # Permit all existing products to use the new group if makeproductgroups.
     if ($cgi->param('insertnew')) {
         $dbh->do('INSERT INTO group_control_map
-                  (group_id, product_id, entry, membercontrol,
-                   othercontrol, canedit)
-                  SELECT ?, products.id, 0, ?, ?, 0 FROM products',
+                  (group_id, product_id, membercontrol, othercontrol)
+                  SELECT ?, products.id, ?, ? FROM products',
                   undef, ($group->id, CONTROLMAPSHOWN, CONTROLMAPNA));
     }
     delete_token($token);
index 93228fc67dd03e5134e1ddd3b3428487e235c167..c43641fb6ee46c389bb718a28979400a5711df31 100755 (executable)
@@ -140,14 +140,10 @@ if ($cgi->param('createmissinggroupcontrolmapentries')) {
     my $na    = CONTROLMAPNA;
     my $shown = CONTROLMAPSHOWN;
     my $insertsth = $dbh->prepare(
-        qq{INSERT INTO group_control_map (
-                       group_id, product_id, entry,
-                       membercontrol, othercontrol, canedit
-                      )
-               VALUES (
-                       ?, ?, 0,
-                       $shown, $na, 0
-                      )});
+        qq{INSERT INTO group_control_map
+                       (group_id, product_id, membercontrol, othercontrol)
+                VALUES (?, ?, $shown, $na)});
+
     my $updatesth = $dbh->prepare(qq{UPDATE group_control_map
                                         SET membercontrol = $shown
                                       WHERE group_id   = ?
index 440e1cf2f626dc765ade5387258b599ba13cd5b0..ab39a914999133c8fdaac0b957da8ef111f9c30a 100644 (file)
   makeproductgroups => "If this is on, $terms.Bugzilla will associate $terms.abug group " _
                        "with each product in the database, and use it for querying ${terms.bugs}.",
 
-  useentrygroupdefault => "If this is on, $terms.Bugzilla will use product $terms.bug groups " _
-                          "by default to restrict who can enter ${terms.bugs}. If this is on, " _
-                          "users can see any product to which they have entry access in search menus. " _
-                          "If this is off, users can see any product to which they have not " _
-                          "been excluded by a mandatory restriction.",
-
   chartgroup => "The name of the group of users who can use the 'New Charts' " _
                 "feature. Administrators should ensure that the public categories " _
                 "and series definitions do not divulge confidential information " _