本文整理汇总了PHP中Admin::hasPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::hasPermission方法的具体用法?PHP Admin::hasPermission怎么用?PHP Admin::hasPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::hasPermission方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
foreach (array(Am_Auth_Admin::PERM_LOGS, Am_Auth_Admin::PERM_LOGS_ACCESS, Am_Auth_Admin::PERM_LOGS_INVOICE, Am_Auth_Admin::PERM_LOGS_MAIL, Am_Auth_Admin::PERM_LOGS_ADMIN) as $perm) {
if ($admin->hasPermission($perm)) {
return true;
}
}
return false;
}
示例2: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Auth_Admin::PERM_REPORT);
}
示例3: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission("grid_content");
}
示例4: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Auth_Admin::PERM_SYSTEM_INFO);
}
示例5: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Plugin_Oto::ADMIN_PERM_ID);
}
示例6: hasPermission
public function hasPermission(Admin $admin)
{
return $admin->hasPermission($this->permission);
}
示例7: getAdminPermission
protected function getAdminPermission(Admin $identity, $prefix)
{
if ($identity->isSuper()) {
return self::ACCESS_ALL;
}
$prefixList = $this->getPrefixACList();
$prefixAC = $prefixList[$prefix];
$perm = self::ACCESS_NONE;
if (isset($prefixAC[self::IDENTITY_TYPE_ADMIN])) {
if (is_array($prefixAC[self::IDENTITY_TYPE_ADMIN])) {
foreach ($prefixAC[self::IDENTITY_TYPE_ADMIN] as $globPerm => $uploadPerm) {
if ($identity->hasPermission($globPerm)) {
$perm |= $uploadPerm;
}
}
} else {
$perm = $prefixAC[self::IDENTITY_TYPE_ADMIN];
}
}
return $perm;
}
示例8: getAdminPermission
protected function getAdminPermission(Admin $identity, $prefix)
{
if ($identity->isSuper()) {
return self::ACCESS_ALL;
}
$prefixList = $this->getPrefixACList();
$prefixAC = $prefixList[$prefix];
$perm = self::ACCESS_NONE;
if (isset($prefixAC[self::IDENTITY_TYPE_ADMIN])) {
if (is_array($prefixAC[self::IDENTITY_TYPE_ADMIN])) {
foreach ($prefixAC[self::IDENTITY_TYPE_ADMIN] as $globPerm => $uploadPerm) {
preg_match('/^([^][]*)(\\[([^][]*)])?$/i', $globPerm, $matches);
if ($identity->hasPermission($matches[1], isset($matches[3]) ? $matches[3] : null)) {
$perm |= $uploadPerm;
}
}
} else {
$perm = $prefixAC[self::IDENTITY_TYPE_ADMIN];
}
}
return $perm;
}
示例9: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission('grid_invoice', 'browse') || $admin->hasPermission('grid_access', 'browse') || $admin->hasPermission('grid_payment', 'browse');
}
示例10: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Auth_Admin::PERM_SUPER_USER);
}
示例11: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Auth_Admin::PERM_TRANSLATION);
}
示例12: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Bootstrap_Helpdesk::ADMIN_PERM_ID);
}
示例13: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Auth_Admin::PERM_BACKUP_RESTORE);
}
示例14: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Auth_Admin::PERM_COUNTRY_STATE);
}
示例15: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
return $admin->hasPermission(Am_Auth_Admin::PERM_BUILD_DEMO);
}