[Fusionforge-commits] r11201 - trunk/src/common/include
Roland Mas
lolando at libremir.placard.fr.eu.org
Tue Oct 26 19:57:42 CEST 2010
Author: lolando
Date: 2010-10-26 19:57:42 +0200 (Tue, 26 Oct 2010)
New Revision: 11201
Modified:
trunk/src/common/include/Group.class.php
Log:
Fixed permissions for Anonymous and LoggedIn roles on frs/trackers/pm/docman for new projects
Modified: trunk/src/common/include/Group.class.php
===================================================================
--- trunk/src/common/include/Group.class.php 2010-10-26 16:49:15 UTC (rev 11200)
+++ trunk/src/common/include/Group.class.php 2010-10-26 17:57:42 UTC (rev 11201)
@@ -2373,29 +2373,56 @@
$ra = RoleAnonymous::getInstance() ;
$rl = RoleLoggedIn::getInstance() ;
$ra->linkProject ($this) ;
+ $rl->linkProject ($this) ;
+
$ra->setSetting ('project_read', $this->getID(), 1) ;
$rl->setSetting ('project_read', $this->getID(), 1) ;
+
+ $ra->setSetting ('frs', $this->getID(), 1) ;
+ $rl->setSetting ('frs', $this->getID(), 1) ;
+
+ $ra->setSetting ('docman', $this->getID(), 1) ;
+ $rl->setSetting ('docman', $this->getID(), 1) ;
+
$ff = new ForumFactory ($this) ;
- foreach ($ff->getForums() as $f) {
+ foreach ($ff->getAllForumIds() as $fid) {
+ $f = forum_get_object ($fid) ;
if ($f->isPublic()) {
$l = $f->getModerationLevel() ;
+ if ($l == 0) {
+ $rl->setSetting ('forum', $fid, 3) ;
+ } else {
+ $rl->setSetting ('forum', $fid, 2) ;
+ }
if ($f->allowAnonymous()) {
if ($l == 0) {
- $ra->setSetting ('forum', $f->getID(), 3) ;
+ $ra->setSetting ('forum', $fid, 3) ;
} else {
- $ra->setSetting ('forum', $f->getID(), 2) ;
+ $ra->setSetting ('forum', $fid, 2) ;
}
} else {
- $ra->setSetting ('forum', $f->getID(), 1) ;
- $rl->linkProject ($this) ;
- if ($l == 0) {
- $rl->setSetting ('forum', $f->getID(), 3) ;
- } else {
- $rl->setSetting ('forum', $f->getID(), 2) ;
- }
+ $ra->setSetting ('forum', $fid, 1) ;
}
}
}
+
+ $pgf = new ProjectGroupFactory ($this) ;
+ foreach ($pgf->getAllProjectGroupIds() as $pgid) {
+ $pg = projectgroup_get_object ($pgid) ;
+ if ($pg->isPublic()) {
+ $ra->setSetting ('pm', $pgid, 1) ;
+ $rl->setSetting ('pm', $pgid, 1) ;
+ }
+ }
+
+ $atf = new ArtifactTypeFactory ($this) ;
+ foreach ($atf->getAllArtifactTypeIds() as $atid) {
+ $at = artifactType_get_object ($atid) ;
+ if ($at->isPublic()) {
+ $ra->setSetting ('tracker', $atid, 1) ;
+ $rl->setSetting ('tracker', $atid, 1) ;
+ }
+ }
}
foreach (get_group_join_requests ($this) as $gjr) {
$gjr->delete (true) ;
More information about the Fusionforge-commits
mailing list