本文整理汇总了PHP中FabrikWorker::getACLGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP FabrikWorker::getACLGroups方法的具体用法?PHP FabrikWorker::getACLGroups怎么用?PHP FabrikWorker::getACLGroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FabrikWorker
的用法示例。
在下文中一共展示了FabrikWorker::getACLGroups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getACL
/**
* determine if you can use a thing
* uses JACL if available
* @param int access id
* @param string access object identifier
* @param string acl direction (inclusive or exclusive - not tested for JACL integration )
* @return bool truye if access granted
*/
function getACL($a, $key, $cond = '>=')
{
$user =& JFactory::getUser();
$acl =& JFactory::getACL();
//everyone
if ($a == 0) {
return true;
}
//nobody
if ($a == '26') {
return false;
}
//public front end
// $$$ rob: for below commented out if statement
// if prefilter set to 'Apply filter on or beneath: public front end/29'
// then it was still applying the prefilter to registered users
// $$$ rob 07/04/2011 however we do need a check if cont = '>=' for 'Public front end / $a = 29
if ($a == 29 && $cond == '>=') {
return true;
}
//if ($a == '29' || $a == '') {
if ($a == '') {
if ($cond == '>=') {
return true;
//jacl
} else {
return false;
}
}
if (defined('_JACL')) {
$inacl = in_array($a, explode(',', $user->get('jaclplus', '0')));
if ($cond == '<=') {
return !$inacl;
} else {
return $inacl;
}
} else {
$groupNames =& FabrikWorker::getACLGroups($a, $cond);
foreach ($groupNames as $name) {
FabrikWorker::setACL('action', $key, 'fabrik', $name, 'components', null);
}
//if not logged in set the usertype to ROOT (ie public front end)
$utype = $user->get('usertype') == '' ? 'ROOT' : $user->get('usertype');
return $acl->acl_check('action', $key, 'fabrik', $utype, 'components', null);
}
}