From: edward Date: Wed, 30 Mar 2016 10:54:56 +0000 (+0800) Subject: RooTrait.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=dda4ce94271aae08d16f68e42a075c5c583ba99b RooTrait.php --- diff --git a/RooTrait.php b/RooTrait.php index bb94e16c..23cbfd9d 100644 --- a/RooTrait.php +++ b/RooTrait.php @@ -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.');