本文整理汇总了PHP中PermissionsManager::getAuthorizedUgroups方法的典型用法代码示例。如果您正苦于以下问题:PHP PermissionsManager::getAuthorizedUgroups方法的具体用法?PHP PermissionsManager::getAuthorizedUgroups怎么用?PHP PermissionsManager::getAuthorizedUgroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PermissionsManager
的用法示例。
在下文中一共展示了PermissionsManager::getAuthorizedUgroups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUgroups
/**
* Return the list of UGroupIds according to Git permissions that can be managed by Gerrit
*
* @param Integer $repository_id
* @param String $permission_type
*
* @return array
*/
public function getUgroups($repository_id, $permission_type)
{
if ($permission_type == Git::SPECIAL_PERM_ADMIN) {
return array(ProjectUGroup::PROJECT_ADMIN);
}
$ugroup_ids = $this->permissions_manager->getAuthorizedUgroups($repository_id, $permission_type, false);
$result = array();
foreach ($ugroup_ids as $row) {
$result[] = $row['ugroup_id'];
}
return $result;
}
示例2: isUserAllowedToSeeTransition
public function isUserAllowedToSeeTransition(PFUser $user, $project_id)
{
$transition_ugroups = $this->permission_manager->getAuthorizedUgroups($this->transition->getId(), self::PERMISSION_TRANSITION);
foreach ($transition_ugroups as $ugroup) {
if ($user->isMemberOfUGroup($ugroup['ugroup_id'], $project_id)) {
return true;
}
}
return false;
}