public function actionPhpgacl() { Yii::import('application.extensions.hole.acl.*'); $acl = new CHolePhpGaclAdapter(); var_dump($acl->getUserGroupIds('pelanggan')); var_dump($acl->getPermissionsOnContent('', 'everyone', 'ild')); $aclHelper = new CHoleAclHelper(); var_dump($aclHelper->isAllowedToView('ild')); if ($aclHelper->isAllowedToView('ild')) { echo 'test'; } else { echo "mboh"; } echo $_SERVER['REQUEST_URI']; echo iconv('UTF-8', 'ASCII//TRANSLIT', "kampret"); }
private function _isAllowedToView($catalogGuid) { Yii::import('application.extensions.hole.acl.*'); $aclHelper = new CHoleAclHelper(); $db = Yii::app()->db; $query = "select profileGuid from KutuCatalog where guid='{$catalogGuid}'"; $command = $db->createCommand($query); //var_dump($command);die; $dataReader = $command->query(); $rows = $dataReader->readAll(); if (count($rows) > 0) { /*switch ($rows[0]['profileGuid']) { case 'ilb': case 'ild': return $aclHelper->isAllowedToView($rows[0]['profileGuid']); default: return true; }*/ return $aclHelper->isAllowedToView($rows[0]['profileGuid']); } return false; }
public function isAllowedToView() { Yii::import('application.extensions.hole.acl.*'); $aclHelper = new CHoleAclHelper(); if (!empty($this->_catalog)) { if (!empty($this->_catalog['catalog']['profileGuid'])) { /*switch ($this->_catalog['catalog']['profileGuid']) { case 'ilb': case 'ild': return $aclHelper->isAllowedToView($this->_catalog['catalog']['profileGuid']); default: //return true; }*/ return $aclHelper->isAllowedToView($this->_catalog['catalog']['profileGuid']); } } return false; }