}
- function checkDebugPost()
- {
- return (!empty($_GET['_post']) || !empty($_GET['_debug_post'])) &&
- $this->authUser &&
- method_exists($this->authUser,'groups') &&
- in_array('Administrators', $this->authUser->groups('name'));
-
- }
-
function dataObject($tab)
{
if (is_array($this->validTables) && !in_array($tab, $this->validTables)) {
return $x;
}
+
/*
* From Pman.php
*/
}
-
-
function addEvent($act, $obj = false, $remarks = '')
{
-
if (!empty(HTML_FlexyFramework::get()->Pman['disable_events'])) {
return;
}
- $au = $this->getAuthUser();
-
$e = DB_DataObject::factory('Events');
$e->init($act,$obj,$remarks);
$wa->notifyEvent($e); // trigger any actions..
}
-
$e->onInsert(isset($_REQUEST) ? $_REQUEST : array() , $this);
return $e;
}
- function getAuthUser()
+ function checkPerm($obj, $lvl, $req= null)
{
- if (!empty($this->authUser)) {
- return $this->authUser;
+ if (!method_exists($obj, 'checkPerm')) {
+ return true;
}
- $ff = HTML_FlexyFramework::get();
- $tbl = empty($ff->Pman['authTable']) ? 'Person' : $ff->Pman['authTable'];
-
- $u = DB_DataObject::factory( $tbl );
- if (!$u->isAuth()) {
- return false;
+ if ($obj->checkPerm($lvl, $this->getAuthUser(), $req)) {
+ return true;
}
- $this->authUser =$u->getAuthUser();
- return $this->authUser ;
+
+ return false;
+ }
+
+ function getAuthUser()
+ {
+ die('Get auth user is not implement.');
}
}