Code

Updated Addressbook ACLs.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Feb 2009 14:17:46 +0000 (14:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Feb 2009 14:17:46 +0000 (14:17 +0000)
-Fixed acls.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13398 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc

index cd7e499c0308f2ba4c501809ce251540218172b6..c4d7e393fc05fed47bdcfd9fcd6d42fc45d9a850 100644 (file)
@@ -780,23 +780,38 @@ class addressbook extends plugin
     }
   }
 
-  
   /* Return entry acls */
   function get_entry_acls($dn,$attr = "")
   {
     $acls = "";
-  
-    /* Use addressbook acls */
-    if(preg_match("/".preg_quote($this->abobjectclass, '/')."/",$dn))  {
+    $combineACLs = TRUE;
+
+    /* If combineACLs is set to false:
+       Differentiate between user and addressbook acls, thus leads into two object categories.
+        - real GOsa users
+        - and addressbook entries
+       To view addressbook entries (e.g. ou=addressbook,) you just require permissions on the ldap base for 'addressbook'.
+       To view real GOsa users you have to additionally add user permissions.
+
+       You can enable this option, to use only addressbook acls (default).
+     */
+    if($combineACLs){
       $dn = preg_replace("/".preg_quote($this->abobjectclass, '/').",/","",$dn);
       $acls = $this->ui->get_permissions($dn,"addressbook/addressbook",$attr);
-    }
-    
-    /* Use Organizational Person acls */
-    else{
-      $acls = $this->ui->get_permissions($dn,"users/user",$attr);
-    }
+    }else{
+
+      /* Use addressbook acls */
+      if(preg_match("/".preg_quote($this->abobjectclass, '/')."/",$dn))  {
+        $dn = preg_replace("/".preg_quote($this->abobjectclass, '/').",/","",$dn);
+        $acls = $this->ui->get_permissions($dn,"addressbook/addressbook",$attr);
+      }
 
+      /* Use Organizational Person acls */
+      else{
+        $acls = $this->ui->get_permissions($dn,"users/user",$attr);
+      }
+    }
     return($acls);
   }