Commits

Arie W. Subagja committed d238c09

acl support

  • Participants
  • Parent commits e374110

Comments (0)

Files changed (2)

                 'title'     => __('Create new post'),
                 'url'       => 'admin-post',                // route name
                 'params'    => array('action' => 'create'), // with params
+                'acl'       => 'can_create_celebrity',
             ),
         ),
     );

classes/malam/menu.php

 
         foreach ($this->section as $sec)
         {
-            $this->items[] = new Menu_Item($sec, $this->parent, ltrim($url, '/'));
+            $sec += array('acl' => NULL);
+            $acl = Arr::get($sec, 'acl');
+
+            if (NULL === $acl || TRUE === $this->check_acl($acl))
+            {
+                $this->items[] = new Menu_Item($sec, $this->parent, ltrim($url, '/'));
+            }
         }
     }
 
+    public function check_acl($acl)
+    {
+        return TRUE;
+    }
+
     public function set_theme($theme)
     {
         self::$theme = $theme;