This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  e1426872b5593ad2a0ada0ed22faea5e7c2d794f (commit)
      from  00140abb2760acb3589a2dda70ed5253087ab7ea (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=e1426872b5593ad2a0ada0ed22faea5e7c2d794f

commit e1426872b5593ad2a0ada0ed22faea5e7c2d794f
Author: Franck Villaume <[email protected]>
Date:   Mon Aug 16 12:41:38 2021 +0200

    fix new permission setting : members. Previous commit break anonymous 
support

diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index 03002d5..9a71330 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -156,19 +156,7 @@ abstract class BaseRole extends FFError {
                                                     'pm_admin' => 1,
                                                     'new_pm' => 7,
                                                     'members' => 1,
-                               ),
-                       // all other (present) roles
-                       'other' => array( 'project_read' => 1,
-                                                    'frs_admin' => 1,
-                                                    'new_frs' => 1,
-                                                    'docman' => 3,
-                                                    'new_forum' => 3,
-                                                    'tracker_admin' => 1,
-                                                    'new_tracker' => 11,
-                                                    'pm_admin' => 1,
-                                                    'new_pm' => 7,
-                                                    'members' => 1,
-                               ),
+                               )
                        );
        }
 
@@ -365,7 +353,7 @@ abstract class BaseRole extends FFError {
                $result = array();
                $group_id = $project->getID();
 
-               $sections = array ('project_read', 'project_admin', 'scm', 
'docman', 'tracker_admin', 'new_tracker', 'members');
+               $sections = array ('project_read', 'project_admin', 'members', 
'scm', 'docman', 'tracker_admin', 'new_tracker');
                foreach ($sections as $section) {
                        $result[$section][$group_id] = $this->getVal ($section, 
$group_id);
                }
@@ -487,13 +475,6 @@ abstract class BaseRole extends FFError {
         */
        function getSetting($section, $reference) {
                $value = $this->getSettingRaw($section, $reference);
-               if ($value == NULL) {
-                       if (isset($this->defaults['other'][$section])) {
-                               $value = $this->defaults['other'][$section];
-                       } else {
-                               $value = 0;
-                       }
-               }
 
                switch ($section) {
                case 'forge_admin':
@@ -1395,8 +1376,3 @@ function sortRoleList (&$list, $relative_to = NULL, 
$criterion='composite') {
 
        return usort ($list, array ($cmp, 'Compare'));
 }
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/db/20210816-new-permission-members.php 
b/src/db/20210816-new-permission-members.php
new file mode 100644
index 0000000..3dc4a81
--- /dev/null
+++ b/src/db/20210816-new-permission-members.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Inject new permission "members" to existing roles.
+ * Copyright, 2021, Franck Villaume - TrivialDev
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once dirname(__FILE__).'/../common/include/env.inc.php';
+require_once $gfcommon.'include/pre.php';
+
+
+ini_set('memory_limit', -1);
+ini_set('max_execution_time', 0);
+
+$roleids = db_query_params('select role_id from pfo_role_setting group by 
role_id order by role_id');
+while ($roleid = db_fetch_array($roleids)) {
+       db_query_params('insert into pfo_role_setting (role_id, section_name, 
perm_val) VALUES ($1, \'members\', 1)', array($roleid['role_id']));
+}
+echo "SUCCESS\n";
+exit(0);

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/RBAC.php                        | 28 ++--------------------
 ...nss.php => 20210816-new-permission-members.php} | 18 +++++++-------
 2 files changed, 12 insertions(+), 34 deletions(-)
 copy src/db/{20150317-nss.php => 20210816-new-permission-members.php} (66%)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to