本文整理汇总了PHP中_root::getACL方法的典型用法代码示例。如果您正苦于以下问题:PHP _root::getACL方法的具体用法?PHP _root::getACL怎么用?PHP _root::getACL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_root
的用法示例。
在下文中一共展示了_root::getACL方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _login
public function _login()
{
$oView = new _view('auth::login');
$this->oLayout->add('main', $oView);
if (_root::getRequest()->isPost()) {
$sLogin = _root::getParam('login');
$sPass = sha1(_root::getParam('password'));
$oModelAccount = new model_account();
$tAccount = $oModelAccount->getListAccount();
if (_root::getAuth()->checkLoginPass($tAccount, $sLogin, $sPass)) {
$oAccount = _root::getAuth()->getAccount();
$tPermission = model_permission::getInstance()->findByGroup($oAccount->groupe);
//on purge les permissions en session
_root::getACL()->purge();
//boucle sur les permissions
if ($tPermission) {
foreach ($tPermission as $oPermission) {
if ($oPermission->allowdeny == 'ALLOW') {
_root::getACL()->allow($oPermission->action, $oPermission->element);
} else {
_root::getACL()->deny($oPermission->action, $oPermission->element);
}
}
}
_root::redirect('prive::list');
}
}
}
示例2: before
public function before()
{
_root::getAuth()->enable();
//on check les permissions
if (!_root::getACL()->can('edit', 'acl')) {
_root::redirect('prive::list');
}
$this->oLayout = new _layout('template1');
$this->oLayout->addModule('menu', 'menu::index');
}
示例3: _index
public function _index()
{
$tLink = array('Articles' => 'article::list', 'Articles pagine' => 'article::listPagination', 'Articles via module table' => 'article::listModuleTable', 'Utiliser des classes metiers' => 'article::myclass', 'Appeler des sous module' => 'private_article::list', 'Graphiques' => 'chart::examples', 'Graphiques SVG' => 'chart::examplesSVG', 'Google Map' => 'default::googleMap', 'Auteurs xml' => 'auteurxml::list', 'Products "virtuel"' => 'virtualProducts::list', 'Prive' => 'prive::list');
if (_root::getACL()->can('edit', 'acl')) {
$tLink['Manage accounts'] = 'account::list';
$tLink['Manage groups'] = 'group::list';
$tLink['Manage permission'] = 'permission::list';
}
$oView = new _view('menu::index');
$oView->tLink = $tLink;
return $oView;
}
示例4: _edit
public function _edit()
{
if (!_root::getACL()->can('edit', 'article')) {
//on verifie que l'utilisateur a le droit d'acceder a cette page
_root::redirect('prive::list');
}
$tMessage = $this->save();
$oArticleModel = new model_article();
$oArticle = $oArticleModel->findById(_root::getParam('id'));
$oView = new _view('prive::edit');
$oView->oArticle = $oArticle;
$oView->tColumn = $oArticleModel->getListColumn();
$oView->tId = $oArticleModel->getIdTab();
$oPluginXsrf = new plugin_xsrf();
$oView->token = $oPluginXsrf->getToken();
$oView->tMessage = $tMessage;
$this->oLayout->add('main', $oView);
}
示例5: loadForUser
public function loadForUser($oUser)
{
//on purge
_root::getACL()->purge();
$tPermission = $this->findListByGroup($oUser->exampleUserGroups_id);
if ($tPermission) {
foreach ($tPermission as $oPermission) {
_root::getACL()->allow($oPermission->actionName, $oPermission->itemName);
}
}
}
示例6:
?>
">Edit</a>
</td>
<?php
}
?>
</tr>
<?php
}
?>
<?php
}
?>
</table>
<?php
if (_root::getACL()->can('add', 'article')) {
?>
<p ><a href="<?php
echo $this->getLink('prive::new');
?>
">New</a></p>
<?php
}
?>