[Fusionforge-commits] FusionForge branch master updated. 5173ea77a74336fc82b4eb33a0f8742cd223fcd8

Franck VILLAUME nerville at fusionforge.org
Fri May 3 14:23:01 CEST 2013


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  5173ea77a74336fc82b4eb33a0f8742cd223fcd8 (commit)
      from  8ef71344aeeb1fc9bac6ff5eec0f73f3f2c78092 (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 -----------------------------------------------------------------
commit 5173ea77a74336fc82b4eb33a0f8742cd223fcd8
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri May 3 14:22:25 2013 +0200

    RBAC: fix behavior when project is hidden for the role

diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index 967f50a..875200e 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -444,11 +444,18 @@ abstract class BaseRole extends Error {
 			break ;
 
 		case 'project_read':
+			if ($this->hasPermission('project_admin', $reference)) {
+				return 1;
+			}
+			return $value;
+			break;
 		case 'tracker_admin':
 		case 'pm_admin':
 		case 'forum_admin':
 			if ($this->hasPermission('project_admin', $reference)) {
 				return 1 ;
+			} elseif (!$this->hasPermission('project_read', $reference)) {
+				return 0;
 			}
 			return $value ;
 			break ;
@@ -456,6 +463,8 @@ abstract class BaseRole extends Error {
 		case 'scm':
 			if ($this->hasPermission('project_admin', $reference)) {
 				return 2 ;
+			} elseif (!$this->hasPermission('project_read', $reference)) {
+				return 0;
 			}
 			return $value ;
 			break ;
@@ -463,6 +472,8 @@ abstract class BaseRole extends Error {
 		case 'docman':
 			if ($this->hasPermission('project_admin', $reference)) {
 				return 4 ;
+			} elseif (!$this->hasPermission('project_read', $reference)) {
+				return 0;
 			}
 			return $value ;
 			break ;
@@ -470,6 +481,8 @@ abstract class BaseRole extends Error {
 		case 'frs':
 			if ($this->hasPermission('project_admin', $reference)) {
 				return 3 ;
+			} elseif (!$this->hasPermission('project_read', $reference)) {
+				return 0;
 			}
 			return $value ;
 			break ;
@@ -477,12 +490,16 @@ abstract class BaseRole extends Error {
 		case 'forum':
 			if ($this->hasPermission('forum_admin', forum_get_groupid($reference))) {
 				return 4 ;
+			} elseif (!$this->hasPermission('project_read', forum_get_groupid($reference))) {
+				return 0;
 			}
 			return $value ;
 			break ;
 		case 'new_forum':
 			if ($this->hasPermission('forum_admin', $reference)) {
 				return 4 ;
+			} elseif (!$this->hasPermission('project_read', $reference)) {
+				return 0;
 			}
 			return $value ;
 			break ;
@@ -490,12 +507,16 @@ abstract class BaseRole extends Error {
 		case 'tracker':
 			if ($this->hasPermission('tracker_admin', artifacttype_get_groupid($reference))) {
 				return 5 | $value ;
+			} elseif (!$this->hasPermission('project_read', artifacttype_get_groupid($reference))) {
+				return 0;
 			}
 			return $value ;
 			break ;
 		case 'new_tracker':
 			if ($this->hasPermission('tracker_admin', $reference)) {
 				return 5 | $value ;
+			} elseif (!$this->hasPermission('project_read', $reference)) {
+				return 0;
 			}
 			return $value ;
 			break ;
@@ -503,12 +524,16 @@ abstract class BaseRole extends Error {
 		case 'pm':
 			if ($this->hasPermission('pm_admin', projectgroup_get_groupid($reference))) {
 				return 5 | $value ;
+			} elseif (!$this->hasPermission('project_read', projectgroup_get_groupid($reference))) {
+				return 0;
 			}
 			return $value ;
 			break ;
 		case 'new_pm':
 			if ($this->hasPermission('pm_admin', $reference)) {
 				return 5 | $value ;
+			} elseif (!$this->hasPermission('project_read', $reference)) {
+				return 0;
 			}
 			return $value ;
 			break ;

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

Summary of changes:
 src/common/include/RBAC.php |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list