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


PHP PFUser::isMember方法代码示例

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


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

示例1: userHasPermissionOnPlanning

 public function userHasPermissionOnPlanning($planning_id, $group_id, PFUser $user, $permission)
 {
     return $user->isMember($group_id) && $user->hasPermission($permission, $planning_id, $group_id);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:PlanningPermissionsManager.class.php

示例2: userCanAdmin

 /**
  * Test is user can administrate FRS service of given project
  *
  * @param PFUser    $user    User to test
  * @param Integer $groupId Project
  *
  * @return Boolean
  */
 public static function userCanAdmin($user, $groupId)
 {
     return $user->isSuperUser() || $user->isMember($groupId, 'R2') || $user->isMember($groupId, 'A');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:FRSPackageFactory.class.php

示例3: userIsRestrictedAndNotMemberOfProject

 private function userIsRestrictedAndNotMemberOfProject(PFUser $user, Project $project)
 {
     return $user->isRestricted() && !$user->isMember($project->getID()) && $this->project_manager->checkRestrictedAccessForUser($project, $user);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:PermissionChecker.class.php

示例4: restrictedMemberIsNotProjectMember

 private function restrictedMemberIsNotProjectMember(PFUser $user, $project_id)
 {
     return $user->isRestricted() && !$user->isMember($project_id);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:Layout.class.php

示例5: getUserProjectsAsOptions

 public function getUserProjectsAsOptions(PFUser $user, ProjectManager $manager, $currentProjectId)
 {
     $purifier = Codendi_HTMLPurifier::instance();
     $html = '';
     $option = '<option value="%d" title="%s">%s</option>';
     $usrProject = array_diff($user->getAllProjects(), array($currentProjectId));
     foreach ($usrProject as $projectId) {
         $project = $manager->getProject($projectId);
         if ($user->isMember($projectId, 'A') && $project->usesService(GitPlugin::SERVICE_SHORTNAME)) {
             $projectName = $project->getPublicName();
             $projectUnixName = $purifier->purify($project->getUnixName());
             $html .= sprintf($option, $projectId, $projectUnixName, $projectName);
         }
     }
     return $html;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:16,代码来源:GitViews.class.php

示例6: userIsRestrictedAndNotProjectMember

 private function userIsRestrictedAndNotProjectMember(PFUser $user, Project $project)
 {
     return $project->allowsRestricted() && $user->isRestricted() && !$user->isMember($project->getID());
 }
开发者ID:slamj1,项目名称:tuleap,代码行数:4,代码来源:MediawikiManager.class.php

示例7: addGenericUserInProject

 private function addGenericUserInProject(PFUser $user, $session_key, $group_id)
 {
     if (!$user->isMember($group_id)) {
         $this->addProjectMember($session_key, $group_id, $user->getUnixName());
     }
 }
开发者ID:bamboolsu,项目名称:tuleap,代码行数:6,代码来源:Project_SOAPServer.class.php

示例8: assertUserCanAccessProject

 public function assertUserCanAccessProject(PFUser $user, Project $project)
 {
     if ($project->isPublic() && $user->isRestricted() && !$user->isMember($project->getGroupId()) || !$project->isPublic() && !$user->isMember($project->getGroupId())) {
         throw new Exception('User do not have access to the project', '3002');
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:SOAP_RequestValidator.class.php

示例9: userCanWrite

 /**
  * Tests if the user is Superuser, or File release admin
  *
  * @param PFUser $user
  * @param Integer $groupId
  *
  * @return Boolean
  */
 function userCanWrite($user, $groupId)
 {
     // R2 refers to File release admin
     return $this->isWriteEnabled() && ($user->isSuperUser() || $user->isMember($groupId, 'R2'));
 }
开发者ID:magarnier,项目名称:tuleap,代码行数:13,代码来源:WebDAVUtils.class.php

示例10: userCanAdmin

 /**
  * Test if user can modify repository configuration
  *
  * @param PFUser $user The user to test
  *
  * @return Boolean
  */
 public function userCanAdmin($user)
 {
     return $user->isMember($this->getProjectId(), 'A');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:GitRepository.class.php

示例11: appendDynamicUGroups

 /**
  * Append project dynamic ugroups of user
  *
  * @param PFUser  $user
  * @param array $user_ugroups
  *
  * @return array the new array of user's ugroup
  */
 private function appendDynamicUGroups(PFUser $user, array $user_ugroups = array())
 {
     $user_projects = $user->getProjects(true);
     foreach ($user_projects as $user_project) {
         $project_name = strtolower($user_project['unix_group_name']);
         $group_id = $user_project['group_id'];
         $user_ugroups[] = $this->ugroupIdToStringWithoutArobase(ProjectUGroup::PROJECT_MEMBERS, $project_name);
         if ($user->isMember($group_id, 'A')) {
             $user_ugroups[] = $this->ugroupIdToStringWithoutArobase(ProjectUGroup::PROJECT_ADMIN, $project_name);
         }
     }
     return $user_ugroups;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:21,代码来源:UGroupLiteralizer.class.php

示例12: removeMailByProjectPrivateRepository

 /**
  * Remove a notified mail address from all private repositories of a project
  *
  * @param Integer $groupId Porject ID to remove its repositories notification
  * @param PFUser    $user    User to exclude from notification
  *
  * @return void
  */
 function removeMailByProjectPrivateRepository($groupId, $user)
 {
     if (!$user->isMember($groupId)) {
         $gitDao = $this->_getGitDao();
         $repositoryList = $gitDao->getProjectRepositoryList($groupId);
         if ($repositoryList) {
             foreach ($repositoryList as $row) {
                 $repository = $this->_getGitRepository();
                 $repository->setId($row['repository_id']);
                 $repository->load();
                 if (!$repository->userCanRead($user)) {
                     if (!$this->removeMailByRepository($repository, $user->getEmail())) {
                         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_git', 'dao_error_remove_notification'));
                     }
                 }
             }
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:27,代码来源:Git_PostReceiveMailManager.class.php

示例13: userCanAccessProject

 /**
  * Ensure given user can access given project
  *
  * @param PFUser  $user
  * @param Project $project
  * @return boolean
  * @throws Project_AccessProjectNotFoundException
  * @throws Project_AccessDeletedException
  * @throws Project_AccessRestrictedException
  * @throws Project_AccessPrivateException
  */
 public function userCanAccessProject(PFUser $user, Project $project)
 {
     if ($project->isError()) {
         throw new Project_AccessProjectNotFoundException();
     } elseif ($user->isSuperUser()) {
         return true;
     } elseif (!$project->isActive()) {
         throw new Project_AccessDeletedException($project);
     } elseif ($user->isMember($project->getID())) {
         return true;
     } elseif ($user->isRestricted() && !$this->canRestrictedUserAccess($user, $project)) {
         throw new Project_AccessRestrictedException();
     } elseif ($project->isPublic()) {
         return true;
     } elseif ($this->userHasBeenDelegatedAccess($user)) {
         return true;
     }
     throw new Project_AccessPrivateException();
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:30,代码来源:URLVerification.class.php

示例14: userCanAccessProject

 /**
  * Ensure given user can access given project
  *
  * @param PFUser  $user
  * @param Project $project
  * @return boolean
  * @throws Project_AccessProjectNotFoundException
  * @throws Project_AccessDeletedException
  * @throws Project_AccessRestrictedException
  * @throws Project_AccessPrivateException
  */
 public function userCanAccessProject(PFUser $user, Project $project)
 {
     if ($project->isError()) {
         throw new Project_AccessProjectNotFoundException();
     } elseif ($user->isSuperUser()) {
         return true;
     } elseif (!$project->isActive()) {
         throw new Project_AccessDeletedException($project);
     } elseif ($user->isMember($project->getID())) {
         return true;
     } elseif ($this->getPermissionsOverriderManager()->doesOverriderAllowUserToAccessProject($user, $project)) {
         return true;
     } elseif ($user->isRestricted()) {
         if (!$project->allowsRestricted() || !$this->restrictedUserCanAccessUrl($user, $this->getUrl(), $_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME'])) {
             throw new Project_AccessRestrictedException();
         }
         return true;
     } elseif ($project->isPublic()) {
         return true;
     } elseif ($this->userHasBeenDelegatedAccess($user)) {
         return true;
     }
     throw new Project_AccessPrivateException();
 }
开发者ID:sunmoonone,项目名称:tuleap,代码行数:35,代码来源:URLVerification.class.php

示例15: userCanRead

 /**
  * Test is user can read the content of this repository and metadata
  *
  * @param PFUser          $user       The user to test
  * @param GitRepository $repository The repository to test
  *
  * @return Boolean
  */
 public function userCanRead($user, $repository)
 {
     return $user->isMember($repository->getProjectId(), 'A') || $user->hasPermission(Git::PERM_READ, $repository->getId(), $repository->getProjectId()) || $user->hasPermission(Git::PERM_WRITE, $repository->getId(), $repository->getProjectId()) || $user->hasPermission(Git::PERM_WPLUS, $repository->getId(), $repository->getProjectId());
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:12,代码来源:Git_Backend_Gitolite.class.php


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