コード例 #1
0
ファイル: Access.php プロジェクト: maniargaurav/OurBank
 public function accessRights($resource, $role, $action)
 {
     $identity = Zend_Auth::getInstance()->getIdentity();
     $resmodel = new App_Model_Users();
     $this->resourceid = $resmodel->getResource($resource);
     $this->roleid = $resmodel->getRole($role);
     $db = Zend_Db_Table::getDefaultAdapter();
     $access = $db->fetchOne("SELECT \n                                    a.activity_id as activity_id\n                                    FROM \n                                    ob_grantactivites a,\n                                    ob_subactivity b\n                                    where a.submodule_id='" . $this->resourceid . "' and \n                                    a.grant_id='" . $this->roleid . "' and \n                                    a.activity_id = b.activity_id and\n                                    b.activity_description = '" . $action . "'");
     if ($access['activity_id']) {
         $accessid = 1;
         return $accessid;
     } else {
         $accessid = 0;
         return $accessid;
     }
 }