本文整理汇总了PHP中FabrikWorker::canUserDo方法的典型用法代码示例。如果您正苦于以下问题:PHP FabrikWorker::canUserDo方法的具体用法?PHP FabrikWorker::canUserDo怎么用?PHP FabrikWorker::canUserDo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FabrikWorker
的用法示例。
在下文中一共展示了FabrikWorker::canUserDo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: canDeleteRepeat
/**
* Can the user delete a repeat group
*
* @since 3.0.1
*
* @return bool
*/
public function canDeleteRepeat()
{
$ok = false;
if ($this->canRepeat()) {
$params = $this->getParams();
$row = $this->getFormModel()->getData();
$ok = FabrikWorker::canUserDo($params, $row, 'repeat_delete_access_user');
if ($ok === -1) {
$groups = $this->user->getAuthorisedViewLevels();
$ok = in_array($params->get('repeat_delete_access', 1), $groups);
}
}
return $ok;
}
示例2: canUserDo
/**
* Access control function for determining if the user can perform
* a designated function on a specific row
*
* @param object $row data
* @param string $col access control setting to compare against
*
* @return mixed - if ACL setting defined here return bool, otherwise return -1 to contiune with default acl setting
*/
protected function canUserDo($row, $col)
{
$params = $this->getParams();
return FabrikWorker::canUserDo($params, $row, $col);
}