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

index bb94e16..23cbfd9 100644 (file)
@@ -154,6 +154,17 @@ trait Pman_Core_RooTrait {
         
     }
     
+    function checkPerm($obj, $lvl, $req= null)
+    {
+        if (!method_exists($obj, 'checkPerm')) {
+            return true;
+        }
+        if ($obj->checkPerm($lvl, $this->getAuthUser(), $req))  {
+            return true;
+        }
+        return false;
+    }
+    
     function getAuthUser()
     {
         die('Get auth user is not implement.');