function authorise($handler)
 {
     $sf = new SiteFunction();
     $sf->clauseSafe('handler', $handler);
     $sf->noForeign();
     if ($sf->get('access_id') == 2) {
         $ret = true;
     } else {
         if ($sf->id()) {
             $ret = false;
         } else {
             if ($handler == str_replace('Application', 'Setup', constant('APPLICATION'))) {
                 $ret = true;
             } else {
                 $ret = $this->authorise(str_replace('Application', 'Setup', constant('APPLICATION')));
             }
         }
     }
     return $ret;
 }
示例#2
0
 /**
  * Return true if this user is allowed to access the given handler
  */
 function authorise($handler)
 {
     $sf = new SiteFunction();
     $sf->noForeign();
     //$sf->clause('handler','%'.$handler,Clause::LIKE);
     $sf->clauseSafe('handler', $handler);
     $access_id = $sf->get('access_id');
     if ($access_id != -1 && $access_id) {
         if ($func = $this->accessible($handler)) {
             $ret = count($func);
         } else {
             $ret = 0;
         }
     } else {
         if ($access_id == -1) {
             $ret = true;
         } else {
             if (!$access_id) {
                 $ret = false;
             }
         }
     }
     return $ret;
 }