Tabnine Logo
ProjectRoleManager
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.atlassian.jira/jira-core

@Override
public ProjectRole getProjectRole(Long projectRoleId)
{
  return projectRoleManager.getProjectRole(projectRoleId);
}
origin: com.atlassian.jira/jira-core

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

  private ProjectRoleActors getProjectRoleActors(String roleId, Project project)
  {
    ProjectRole projectRole = projectRoleManager.getProjectRole(new Long(roleId));
    return projectRoleManager.getProjectRoleActors(projectRole, project);
  }
}
origin: com.atlassian.jira/jira-core

protected boolean isUserInRole(Long roleLevel, ApplicationUser user, Issue issue)
{
  boolean isUserInRole = false;
  ProjectRole projectRole = projectRoleManager.getProjectRole(roleLevel);
  if (projectRole != null)
  {
    isUserInRole = projectRoleManager.isUserInProjectRole(user, projectRole, issue.getProjectObject());
  }
  return isUserInRole;
}
origin: com.atlassian.jira/jira-core

ProjectRole roleByName = projectRoleManager.getProjectRole(projectRole.getName());
if (roleByName != null && !roleByName.getId().equals(projectRole.getId()))
  projectRoleManager.updateRole(projectRole);
origin: com.atlassian.jira/jira-core

eventPublisher.publish(new ProjectRoleUpdatedEvent(project, projectRole,  projectRoleManager.getProjectRoleActors(projectRole, project), projectRoleActors));
origin: com.atlassian.jira/jira-core

final ProjectRoleManager.ProjectIdToProjectRoleIdsMap projectIdToProjectRolesMap = projectRoleManager.createProjectIdToProjectRolesMap(
    searcher, projectIds);
if (!projectIdToProjectRolesMap.isEmpty())
origin: com.atlassian.jira/jira-core

projectRoleManager.deleteRole(projectRole);
clearIssueSecurityLevelCache();
eventPublisher.publish(new ProjectRoleDeletedEvent(projectRole));
origin: com.atlassian.jira/jira-core

createdProjectRole = projectRoleManager.createRole(projectRole);
origin: com.atlassian.jira/jira-core

projectRoleManager.applyDefaultsRolesToProject(newProject);
transaction.commit();
origin: com.atlassian.jira/jira-core

private boolean isUserInRole(Long roleLevel, ApplicationUser user, Issue issue)
{
  boolean isUserInRole = false;
  ProjectRole projectRole = projectRoleManager.getProjectRole(roleLevel);
  if (projectRole != null)
  {
    isUserInRole = projectRoleManager.isUserInProjectRole(user, projectRole, issue.getProjectObject());
  }
  return isUserInRole;
}
origin: com.atlassian.jira/jira-core

ProjectRoleActors projectRoleActors = projectRoleManager.getProjectRoleActors(projectRole, project);
List<ApplicationUser> allUsers = new ArrayList<ApplicationUser>();
int rolesRemovedWithMeInIt = 0;
origin: com.atlassian.jira/jira-core

@Override
public ProjectRole getRoleLevel()
{
  return roleLevelId == null ? null : projectRoleManager.getProjectRole(roleLevelId);
}
origin: com.atlassian.jira/jira-core

private boolean isInRole(final NotificationRecipient recipient, final Project project, final String role)
{
  final ApplicationUser user = recipient.getUserRecipient();
  if (user == null)
  {
    // If we do not have a user then he/she cannot be part of a role. Return false
    return false;
  }
  // Retrieve a role by its name
  final ProjectRole projectRole = projectRoleManager.getProjectRole(role);
  // Return false if we could not find a role or if the user is not part of the role
  return projectRole != null && projectRoleManager.isUserInProjectRole(user, projectRole, project);
}
origin: com.atlassian.jira/jira-core

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

private Collection<ApplicationUser> getUsersByRoles(final Set<Long> roleIds, final Set<Long> projectIds, final Collection<ApplicationUser> existingUsers)
{
  if (CollectionUtils.isEmpty(projectIds) || CollectionUtils.isEmpty(roleIds))
  {
    return existingUsers;
  }
  // only search by roles if projectIds is not empty
  // Note that projectIds list should have been at least populated with the list of browsable projects by the current user
  // create the set to inform following codes that it's not search all
  Collection<ApplicationUser> allUsers = existingUsers == null ? Sets.<ApplicationUser>newHashSet() : existingUsers;
  for (Project project : getProjects(projectIds))
  {
    for (long roleId : roleIds)
    {
      // ok to repeat calls to projectRoleManager, as it has cache
      ProjectRole projectRole = projectRoleManager.getProjectRole(roleId);
      if (projectRole != null)
      {
        allUsers.addAll(projectRoleManager.getProjectRoleActors(projectRole, project).getUsers());
      }
    }
  }
  return allUsers;
}
origin: com.atlassian.jira/jira-core

public ProjectRoleActors getProjectRoleActors(ApplicationUser currentUser, ProjectRole projectRole, Project project, ErrorCollection errorCollection)
{
  boolean internalError = false;
  if (projectRole == null)
  {
    errorCollection.addErrorMessage(getText("project.roles.service.error.project.role.actors.null.project.role"));
    internalError = true;
  }
  if (project == null)
  {
    errorCollection.addErrorMessage(getText("project.roles.service.error.project.role.actors.null.project"));
    internalError = true;
  }
  ProjectRoleActors projectRoleActors = null;
  if (!internalError && hasProjectRolePermission(currentUser, project))
  {
    projectRoleActors = projectRoleManager.getProjectRoleActors(projectRole, project);
  }
  else
  {
    errorCollection.addErrorMessage(getText("project.roles.service.error.project.permission"), ErrorCollection.Reason.FORBIDDEN);
  }
  return projectRoleActors;
}
origin: com.atlassian.jira/jira-core

@Override
public ProjectRole getProjectRole(Long projectRoleId)
{
  return projectRoleManager.getProjectRole(projectRoleId);
}
origin: com.atlassian.jira/jira-core

private boolean userMatchesByRoles(final ApplicationUser user, final Set<Long> roleIds, final Set<Long> projectIds)
{
  if (CollectionUtils.isEmpty(roleIds))
  {
    return false;
  }
  for (Project project : getProjects(projectIds))
  {
    for (long roleId : roleIds)
    {
      // ok to repeat calls to projectRoleManager, as it has cache
      ProjectRole projectRole = projectRoleManager.getProjectRole(roleId);
      if (projectRole != null)
      {
        if (projectRoleManager.isUserInProjectRole(user, projectRole, project))
        {
          return true;
        }
      }
    }
  }
  return false;
}
origin: com.atlassian.jira/jira-core

public Collection<ProjectRole> getProjectRoles()
{
  return projectRoleManager.getProjectRoles();
}
com.atlassian.jira.security.rolesProjectRoleManager

Javadoc

This class allows us to CRUD ProjectRoles. A Project Role is way of grouping the users associated with a project (eg 'Testers', 'Developers').

Most used methods

  • getProjectRole
    Retrieves a project role object by name
  • getProjectRoles
    This will return all the ProjectRoles that the user is currently a member of for the given project.
  • 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
  • isRoleNameUnique,
  • isUserInProjectRole,
  • removeAllRoleActorsByNameAndType,
  • removeAllRoleActorsByProject,
  • roleActorOfTypeExistsForProjects,
  • updateDefaultRoleActors,
  • updateProjectRoleActors,
  • updateRole

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JOptionPane (javax.swing)
  • Best IntelliJ plugins
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