当前位置: 首页>>代码示例>>PHP>>正文


PHP PermissionsManager::addPermission方法代码示例

本文整理汇总了PHP中PermissionsManager::addPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP PermissionsManager::addPermission方法的具体用法?PHP PermissionsManager::addPermission怎么用?PHP PermissionsManager::addPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PermissionsManager的用法示例。


在下文中一共展示了PermissionsManager::addPermission方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: grantAccess

 /**
  * Only grant a permission, no revoke before hand
  *
  * @param type $permission_type
  * @param type $ugroup_id
  */
 public function grantAccess($permission_type, $ugroup_id)
 {
     if (!$this->groupHasPermission($permission_type, $ugroup_id)) {
         $this->permissions_manager->addPermission($permission_type, $this->atid, $ugroup_id);
         $this->stored_ugroups_permissions[$ugroup_id]['permissions'][$permission_type] = 1;
         $this->addHistory($permission_type);
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:PermissionSetter.class.php

示例2: addPermissions

 /**
  * Adds permissions in the database
  *
  * @param array $ugroups The list of ugroups
  *
  * @return boolean
  */
 private function addPermissions($ugroups)
 {
     foreach ($ugroups as $ugroup) {
         if (!$this->permission_manager->addPermission(self::PERMISSION_TRANSITION, (int) $this->transition->getId(), $ugroup)) {
             return false;
         }
     }
     return true;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:16,代码来源:Permissions.class.php

示例3: elseif

if ($isEditor) {
    if (array_key_exists('deladmin', $_GET)) {
        $permManager->deletePermission($_GET['deladmin'], 'CollAdmin', $collId);
    } elseif (array_key_exists('deleditor', $_GET)) {
        $permManager->deletePermission($_GET['deleditor'], 'CollEditor', $collId);
    } elseif (array_key_exists('delrare', $_GET)) {
        $permManager->deletePermission($_GET['delrare'], 'RareSppReader', $collId);
    } elseif (array_key_exists('delidenteditor', $_GET)) {
        $permManager->deletePermission($_GET['delidenteditor'], 'CollTaxon', $collId, $_GET['utid']);
        if (is_numeric($_GET['utid'])) {
            $permManager->deletePermission($_GET['delidenteditor'], 'CollTaxon', $collId, 'all');
        }
    } elseif ($action == 'Add Permissions for User') {
        $rightType = $_POST['righttype'];
        if ($rightType == 'admin') {
            $permManager->addPermission($_POST['uid'], "CollAdmin", $collId);
        } elseif ($rightType == 'editor') {
            $permManager->addPermission($_POST['uid'], "CollEditor", $collId);
        } elseif ($rightType == 'rare') {
            $permManager->addPermission($_POST['uid'], "RareSppReader", $collId);
        }
        /*
        $userRight = '';
        if($rightType == 'admin'){
        	$userRight = 'CollAdmin-'.$collId;
        }
        elseif($rightType == 'editor'){
        	$userRight = 'CollEditor-'.$collId;
        }
        elseif($rightType == 'rare'){
        	$userRight = 'RareSppReader-'.$collId;
开发者ID:urban011,项目名称:ut-prc-symbiota,代码行数:31,代码来源:collpermissions.php

示例4: ProfileManager

        $pHandler = new ProfileManager();
        $pHandler->setUserName($loginAs);
        $pHandler->authenticate();
        header("Location: ../index.php");
    } elseif ($delRole) {
        $userManager->deletePermission($userId, $delRole, $tablePk);
    } elseif (array_key_exists("apsubmit", $_POST)) {
        foreach ($_POST["p"] as $pname) {
            $role = $pname;
            $tablePk = '';
            if (strpos($pname, '-')) {
                $tok = explode('-', $pname);
                $role = $tok[0];
                $tablePk = $tok[1];
            }
            $userManager->addPermission($userId, $role, $tablePk);
        }
    }
}
?>
<html>
<head>
	<title><?php 
echo $defaultTitle;
?>
 User Management</title>
	<meta http-equiv="X-Frame-Options" content="deny">
	<link href="../css/base.css?<?php 
echo $CSS_VERSION;
?>
" type="text/css" rel="stylesheet" />
开发者ID:jphilip124,项目名称:Symbiota,代码行数:31,代码来源:usermanagement.php


注:本文中的PermissionsManager::addPermission方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。