com.atlassian.jira.project.Project.getLeadUserKey()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中com.atlassian.jira.project.Project.getLeadUserKey()方法的一些代码示例,展示了Project.getLeadUserKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getLeadUserKey()方法的具体详情如下:
包路径:com.atlassian.jira.project.Project
类名称:Project
方法名:getLeadUserKey

Project.getLeadUserKey介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public boolean hasPermission(Project project, String argument, ApplicationUser user, boolean issueCreation)
{
  if (project == null)
    throw new IllegalArgumentException("Project passed must not be null");
  if (user == null)
    throw new IllegalArgumentException("User passed must not be null");
  String projectLead = project.getLeadUserKey();
  // User has permission if they are the lead
  return projectLead != null && projectLead.equals(ApplicationUsers.getKeyFor(user));
}

代码示例来源:origin: com.atlassian.jira/jira-core

public static boolean isProjectLeadAssignable(Project project)
{
  return isUserAssignable(project, project.getLeadUserKey());
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
  public Query getQuery(ApplicationUser searcher, Project project, IssueSecurityLevel securityLevel, String parameter)
  {
    //JRA-21648 : Project Lead should not return query for issues that you have no permission for
    if (project.getLeadUserKey() == null || !project.getLeadUserKey().equals(ApplicationUsers.getKeyFor(searcher)))
      return null;

    final BooleanQuery query = new BooleanQuery();
    query.add(new TermQuery(new Term(DocumentConstants.PROJECT_ID,""+project.getId())), BooleanClause.Occur.MUST);
    query.add(super.getQuery(securityLevel), BooleanClause.Occur.MUST);
    return query;
  }
}

代码示例来源:origin: com.atlassian.jira/jira-webhooks-plugin

private UserBean createLeadBean(Project project) {
  final ApplicationUser user = userManager.getUserByKeyEvenWhenUnknown(project.getLeadUserKey());
  return userBeanFactory.createBean(user);
}

代码示例来源:origin: com.atlassian.jira/jira-core

public List<NotificationRecipient> getRecipients(IssueEvent event, String argument)
{
  final Project project = event.getIssue().getProjectObject();
  final String leadKey = project.getLeadUserKey();
  if (leadKey != null)
  {
    final ApplicationUser lead = ComponentAccessor.getUserManager().getUserByKey(leadKey);
    if (lead != null)
    {
      return asList(new NotificationRecipient(lead));
    }
  }
  return Collections.emptyList();
}

代码示例来源:origin: com.atlassian.jira/jira-core

private ApplicationUser useProjectLeadAsDefaultAssignee(Project project)
{
  try
  {
    return getDefaultAssignee(project, project.getLeadUserKey());
  }
  catch (InvalidAssigneeException ex)
  {
    // Project Lead is not found or not assignable
    log.warn("Unable to assign default assignee for project " + project.getKey() + ". " + ex.getMessage());
    throw new DefaultAssigneeException(ex.getMessage());
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

projectLeadUserkey = project.getLeadUserKey();
return isUserAssignable(project, projectLeadUserkey);

代码示例来源:origin: com.atlassian.jira/jira-rest-plugin

private ProjectBeanBuilder summaryProjectBuilder(Project project, String expand)
{
  ProjectBeanBuilder builder = shortProjectBuilder(project)
                  .expand(expand)
                  .description(project.getDescription())
                  .url(project.getUrl())
                  .muteRoles()
                  .muteAssigneeType()
                  .muteUrl();
  //To maintain strict compatibility with previous project list we override the self URL generation behaviour
  //that projects get by default with the behaviour that was present from ProjectJsonBean
  //See JDEV-22464 for more details
  builder.self(URI.create(jiraBaseUrls.restApi2BaseUrl() + "project/" + project.getId().toString()));
  String leadUserKey  = project.getLeadUserKey();
  final ApplicationUser user = userManager.getUserByKeyEvenWhenUnknown(leadUserKey);
  builder.lead(user);
  return builder;
}

代码示例来源:origin: com.atlassian.jira/jira-rest-plugin

String leadUserKey  = project.getLeadUserKey();
final ApplicationUser user = userManager.getUserByKeyEvenWhenUnknown(leadUserKey);
builder.lead(user);

代码示例来源:origin: com.atlassian.jira/jira-core

public String doDefault() throws Exception
{
  // check if the project exists:
  final Project projectObject = getProjectObject();
  if (projectObject == null)
  {
    return handleProjectDoesNotExist();
  }
  if (!(hasProjectAdminPermission() || hasAdminPermission()))
  {
    return "securitybreach";
  }
  setName(projectObject.getName());
  setLead(userKeyService.getUsernameForKey(projectObject.getLeadUserKey()));
  setKeyEdited(false);
  final String key = projectObject.getKey();
  setKey(key);
  setOriginalKey(key);
  setUrl(projectObject.getUrl());
  setDescription(projectObject.getDescription());
  setAssigneeType(projectObject.getAssigneeType());
  setAvatarId(projectObject.getAvatar().getId());
  return INPUT;
}

相关文章