congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ProjectRoleManager.getProjectRoles
Code IndexAdd Tabnine to your IDE (free)

How to use
getProjectRoles
method
in
com.atlassian.jira.security.roles.ProjectRoleManager

Best Java code snippets using com.atlassian.jira.security.roles.ProjectRoleManager.getProjectRoles (Showing top 15 results out of 315)

origin: com.atlassian.jira/jira-core

@Override
public Collection<ProjectRole> getProjectRoles(ErrorCollection errorCollection)
{
  return projectRoleManager.getProjectRoles();
}
origin: com.atlassian.jira/jira-core

public Collection<ProjectRole> getProjectRoles()
{
  return projectRoleManager.getProjectRoles();
}
origin: com.atlassian.jira/jira-core

private Collection<ProjectRole> getAllProjectRoles()
{
  return projectRoleManager.getProjectRoles();
}
origin: com.atlassian.jira/jira-api

private static List<ProjectRole> getProjectRolesFromAll(final ProjectRoleManager projectRoleManager, final Set<Long> roleIds)
{
  // get all project roles and filter, hopefully more efficient than looping through all role ids
  //  and calling getProjectRole one by one
  return Lists.newArrayList(Iterables.filter(projectRoleManager.getProjectRoles(), new Predicate<ProjectRole>()
  {
    @Override
    public boolean apply(final ProjectRole input)
    {
      return roleIds.contains(input.getId());
    }
  }));
}
origin: com.atlassian.jira/jira-core

  public List<ProjectRole> getRoles(final ApplicationUser user, final Long projectId)
  {
    final Project project = projectManager.getProjectObj(projectId);
    return Collections.unmodifiableList(new ArrayList<ProjectRole>(projectRoleManager.getProjectRoles(user, project)));
  }
}
origin: com.atlassian.plugin.deflection/deflection-suggestions

  private Iterable<ProjectRole> getRoleLevels(final User user, Project project)
  {
    final Set<ProjectRole> ret = Sets.newHashSet();
    if (commentService.isProjectRoleVisiblityEnabled())
    {
      if (project == null)
      {
        final Collection<Project> projectsCanBrowse = permissionManager.getProjectObjects(Permissions.BROWSE, user);
        for (Project projectWithBrowse : projectsCanBrowse)
        {
          ret.addAll(projectRoleManager.getProjectRoles(user, projectWithBrowse));
        }
      }
      else
      {
        ret.addAll(projectRoleManager.getProjectRoles(user, project));
      }
    }
    return ret;
  }
}
origin: com.atlassian.jira/jira-core

protected void getVelocityParamsForInput(Map velocityParams)
{
  Map projectRoleMap = new ListOrderedMap();
  ProjectRoleManager projectRoleManager = ComponentAccessor.getComponentOfType(ProjectRoleManager.class);
  final Collection<ProjectRole> projectRoles = projectRoleManager.getProjectRoles();
  for (final ProjectRole projectRole : projectRoles)
  {
    projectRoleMap.put(projectRole.getId().toString(), projectRole.getName());
  }
  velocityParams.put("key", InProjectRoleCondition.KEY_PROJECT_ROLE_ID);
  velocityParams.put("projectroles", projectRoleMap);
}
origin: com.atlassian.jira/jira-core

private Collection getRoleLevels(Project project)
{
  if (project == null) {
    throw new NullPointerException("project GenericValue was null");
  }
  Collection roles;
  if (commentService.isProjectRoleVisibilityEnabled())
  {
    ApplicationUser user = authenticationContext.getUser();
    roles = projectRoleManager.getProjectRoles(user, project);
  }
  else
  {
    roles = Collections.EMPTY_LIST;
  }
  return roles;
}
origin: com.atlassian.cpji/cpji-jira-plugin

Collection<ProjectRole> projectRoles = projectRoleManager.getProjectRoles(jiraAuthenticationContext.getLoggedInUser(), project);
if (!projectRoles.isEmpty())
origin: com.atlassian.jira/jira-core

public Collection<ProjectRole> getRoleLevels()
{
  Collection<ProjectRole> roleLevels;
  if (commentService.isProjectRoleVisibilityEnabled())
  {
    roleLevels = projectRoleManager.getProjectRoles(getLoggedInUser(), getIssueObject().getProjectObject());
  }
  else
  {
    roleLevels = Collections.emptyList();
  }
  return roleLevels;
}
origin: com.atlassian.jira/jira-core

public Collection<ProjectRole> getRoleLevels()
{
  Collection<ProjectRole> roleLevels;
  if (commentService.isProjectRoleVisibilityEnabled())
  {
    roleLevels = projectRoleManager.getProjectRoles(getLoggedInUser(), getIssueObject().getProjectObject());
  }
  else
  {
    roleLevels = Collections.emptyList();
  }
  return roleLevels;
}
origin: com.atlassian.jira/jira-core

private Collection getRoleLevels(Issue issue)
{
  Collection roles;
  if (commentService.isProjectRoleVisibilityEnabled())
  {
    ApplicationUser user = authenticationContext.getUser();
    roles = projectRoleManager.getProjectRoles(user, issue.getProjectObject());
  }
  else
  {
    roles = Collections.EMPTY_LIST;
  }
  return roles;
}
origin: com.atlassian.jira/jira-core

/**
 * @param issue the issue in context
 * @return the Collection of {@link ProjectRole}s for the specified issue that the current user is in - possibly empty
 */
private Collection<ProjectRole> getRoleLevels(Issue issue)
{
  if (authenticationContext.getUser() != null && issue != null && getCommentService().isProjectRoleVisibilityEnabled())
  {
    return getProjectRoleManager().getProjectRoles(authenticationContext.getUser(), issue.getProjectObject());
  }
  return Collections.emptyList();
}
origin: com.atlassian.jira/jira-core

public String getShareTypeEditor(final JiraAuthenticationContext authenticationContext)
{
  Assertions.notNull("authenticationContext", authenticationContext);
  final Map<String, Object> params = new HashMap<String, Object>();
  final Collection<Project> projects = getProjects(authenticationContext.getUser());
  final Set<ProjectRole> roles = new HashSet<ProjectRole>();
  final Map<Long, String> rolesMap = new HashMap<Long, String>();
  for (final Project project : projects)
  {
    final JSONArray array = new JSONArray();
    Collection<ProjectRole> projectRoles = projectRoleManager.getProjectRoles(authenticationContext.getUser(), project);
    roles.addAll(projectRoles);
    projectRoles = sort(projectRoles, ProjectRoleComparator.COMPARATOR);
    for (final Object element : projectRoles)
    {
      final ProjectRole role = (ProjectRole) element;
      array.put(role.getId());
    }
    rolesMap.put(project.getId(), array.toString());
  }
  params.put(ProjectShareTypeRenderer.PROJECTS_KEY, sort(projects, ProjectNameComparator.COMPARATOR));
  params.put(ProjectShareTypeRenderer.ROLES_KEY, sort(roles, ProjectRoleComparator.COMPARATOR));
  params.put(ProjectShareTypeRenderer.ROLES_MAP, rolesMap);
  return renderVelocity("share-type-project-selector.vm", params, authenticationContext);
}
origin: com.atlassian.cpji/cpji-jira-plugin

Collection<ProjectRole> projectRoles = projectRoleManager.getProjectRoles(jiraAuthenticationContext.getLoggedInUser(), project);
try
com.atlassian.jira.security.rolesProjectRoleManagergetProjectRoles

Javadoc

Get all the ProjectRoles available in JIRA. Currently this list is global.

Popular methods of ProjectRoleManager

  • getProjectRole
    Retrieves a project role object by name
  • getProjectRoleActors
    This method will retrieve the object that represents the actors associate with the given projectRole
  • applyDefaultsRolesToProject
    This method will insert all the default roles into the role associations for the provided project. I
  • createProjectIdToProjectRolesMap
  • createRole
    Creates a project role object
  • deleteRole
    Deletes a project role object
  • getDefaultRoleActors
    This method will return the default role actors for a ProjectRole
  • getProjectIdsContainingRoleActorByNameAndType
    Returns the project id's which contain a role actor of the specified name and type within any role.
  • getProjectIdsForUserInGroupsBecauseOfRole
    Returns a Map of Lists. The key of the map is a Long, project id and the value of the map is a list
  • isRoleNameUnique
    Will tell you if a role name exists or not.
  • isUserInProjectRole
    Returns true only if the given user is in the given project role for the given project. This could b
  • removeAllRoleActorsByNameAndType
    This will remove all role actors with the specified name and the specified type. This method should
  • isUserInProjectRole,
  • removeAllRoleActorsByNameAndType,
  • removeAllRoleActorsByProject,
  • roleActorOfTypeExistsForProjects,
  • updateDefaultRoleActors,
  • updateProjectRoleActors,
  • updateRole

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JOptionPane (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now