Code

Added ACLs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Apr 2010 14:08:30 +0000 (14:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Apr 2010 14:08:30 +0000 (14:08 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17823 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/generic/references/class_reference.inc
gosa-core/plugins/generic/references/contents.tpl

index 4c3ab189fba831bd2aa163e9b10daa0965906e25..2cb779472af019f6fb1d91e6c43be97dc21a5ef0 100644 (file)
@@ -124,9 +124,11 @@ class reference extends plugin
         // Assign permissions
         $tmp = $this->plInfo();
         $ui = get_userinfo();
-        foreach($tmp['plProvidedAcls'] as $name => $desc){
-            $smarty->assign($name.'READ', $ui->get_permissions($this->dn, 'references/reference', $name));
-        }
+
+        $category = preg_replace("/\/.*$/", "", $this->acl_category);
+        $smarty->assign('aclREAD',  preg_match("/r/",$ui->get_category_permissions($this->dn, 'acl')));
+        $smarty->assign('completeACL',  $ui->has_complete_category_acls($this->dn, $category)); 
+        $smarty->assign('someACL',      $ui->get_category_permissions($this->dn, $category));
 
         $smarty->assign('objectList', $this->objectList);
         $smarty->assign("acls",$this->aclResolver->getReadableACL());
@@ -134,31 +136,6 @@ class reference extends plugin
         session::set('autocomplete', $this->aclResolver);
         return ($smarty->fetch (get_template_path('contents.tpl', TRUE, dirname(__FILE__))));
     }
-
-
-
-    static function plInfo()
-    {
-        return (array(
-                    "plShortName"   => _("Reference"),
-                    "plDescription" => _("Object references"),
-                    "plSelfModify"  => TRUE,
-                    "plDepends"     => array(),
-                    "plPriority"    => 0,
-                    "plSection"     => array("administration"),
-                    "plCategory"    => array("references" => array("description"  => _("References"),
-                                             "objectClass"  => array())),
-                    "plProvidedAcls"=> array(
-                        "references"   => _("View object references"),
-                        "acl"          => _("View acl trace"),
-                        "info"         => _("View object info"),
-                        "export"       => _("Allow entry export")
-                        )
-
-                    ));
-    }
-
-
 }
 
 ?>
index 37b6c868dd49e74b6c8465dc8923c4b90328472c..f1fbc339c45686327f6e6fba94cc20e975d2f5e5 100644 (file)
@@ -1,6 +1,6 @@
 
 <h3>{t}Object info{/t}</h3>
-{if !$referencesREAD}
+{if !$someACL|regex_replace:"/[cdmr]/":"" == "r"}
     {msgPool type='permView'}
 {else}
     test
@@ -9,8 +9,7 @@
 <table summary='{t}Object references{/t}' class='reference-tab'>
     <tr>
         <td style='width:48%'>
-            {if !$referencesREAD}
-                <h3>{t}Object references{/t}</h3>
+            {if !$completeACL|regex_replace:"/[cdmr]/":"" == "r"}
                 {msgPool type='permView'}
             {else}
                 {$objectList}