RooTrait.php
authoredward <edward@roojs.com>
Wed, 30 Mar 2016 10:57:35 +0000 (18:57 +0800)
committeredward <edward@roojs.com>
Wed, 30 Mar 2016 10:57:35 +0000 (18:57 +0800)
RooTrait.php

index 23973a6..e84ab79 100644 (file)
@@ -164,8 +164,17 @@ trait Pman_Core_RooTrait {
         return false;
     }
     
+    function hasPerm($name, $lvl)  // do we have a permission
+    {
+        static $pcache = array();
+        $au = $this->getAuthUser();
+        return $au && $au->hasPerm($name, $lvl);
+        
+    }
+    
     function getAuthUser()
     {
         die('Get auth user is not implement.');
     }
+    
 }