@Override public void deleteProjectRole(ProjectRole projectRole, ErrorCollection errorCollection) { deleteProjectRole(jiraAuthenticationContext.getLoggedInUser(), projectRole, errorCollection); }
@Override public void removeActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) { removeActorsFromProjectRole(jiraAuthenticationContext.getLoggedInUser(), actors, projectRole, project, actorType, errorCollection, true); }
@Override public void addDefaultActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection) { updateActorsToDefaultRole(jiraAuthenticationContext.getLoggedInUser(), actors, projectRole, type, errorCollection, true); }
@Override public void removeDefaultActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection) { updateActorsToDefaultRole(jiraAuthenticationContext.getLoggedInUser(), actors, projectRole, actorType, errorCollection, false); }
@Override public void removeAllRoleActorsByNameAndType(String name, String type, ErrorCollection errorCollection) { removeAllRoleActorsByNameAndType(jiraAuthenticationContext.getLoggedInUser(), name, type, errorCollection); }
@Override public Collection<Project> getProjectsContainingRoleActorByNameAndType(String name, String type, ErrorCollection errorCollection) { return getProjectsContainingRoleActorByNameAndType(jiraAuthenticationContext.getLoggedInUser(), name, type, errorCollection); }
@Override public void validateLicense(final ErrorCollection errors, final I18nHelper i18n) { validateLicense(authenticationContext.getLoggedInUser(), errors, i18n); }
@Override public boolean hasProjectPermission(ProjectPermissionKey projectPermissionKey, Project project) { return permissionManager.hasPermission(projectPermissionKey, project, jiraAuthenticationContext.getLoggedInUser()); } }
@Override public AddUserToApplicationValidationResult validateAddUserToApplication(ApplicationUser user, ApplicationKey applicationKey) { ApplicationUser loggedInUser = null; if(jiraAuthenticationContext != null) { loggedInUser = jiraAuthenticationContext.getLoggedInUser(); } return validateAddUserToApplication(loggedInUser, user, applicationKey); }
@Override public RemoveUserFromApplicationValidationResult validateRemoveUserFromApplication(ApplicationUser user, ApplicationKey applicationKey) { ApplicationUser loggedInUser = null; if (jiraAuthenticationContext != null) { loggedInUser = jiraAuthenticationContext.getLoggedInUser(); } return this.validateRemoveUserFromApplication(loggedInUser, user, applicationKey); }
/** * @return the URL of the default avatar. */ private String getDefaultAvatarURL() { return avatarService.getAvatarURL(authenticationContext.getLoggedInUser(), (ApplicationUser) null, SMALL).toString(); } }
@Override public boolean shouldDisplay(final Map<String, Object> context) { final ApplicationUser user = authenticationContext.getLoggedInUser(); return user != null && permissionManager.hasPermission(GlobalPermissionKey.ADMINISTER, user); } }
@Override public ProjectRole createProjectRole(ProjectRole projectRole, ErrorCollection errorCollection) { return createProjectRole(jiraAuthenticationContext.getLoggedInUser(), projectRole, errorCollection); }
@Override public void addActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) { updateActorsToProjectRole(jiraAuthenticationContext.getLoggedInUser(), actors, projectRole, project, actorType, errorCollection, true, true); }
@Override public Result evaluate() { return evaluateWithUser(authenticationContext.getLoggedInUser()); }
@Deprecated /** * @deprecated Use {@link com.atlassian.jira.issue.fields.rest.json.WorklogBeanFactory#createBeans(Iterable, ApplicationUser)} instead. Since v7.0. */ public static List<WorklogJsonBean> asBeans(final List<Worklog> worklogs, final JiraBaseUrls uriInfo, final UserManager userManager, final TimeTrackingConfiguration timeTrackingConfiguration) { ApplicationUser loggedInUser = ComponentAccessor.getComponent(JiraAuthenticationContext.class).getLoggedInUser(); return ImmutableList.copyOf(ComponentAccessor.getComponent(WorklogBeanFactory.class).createBeans(worklogs, loggedInUser)); }
@Override public boolean hasProjectPermission(int permissionsId, Project project) { return permissionManager.hasPermission(new ProjectPermissionKey(permissionsId), project, jiraAuthenticationContext.getLoggedInUser()); }
@Override public boolean hasSiteEditPermission() { final ApplicationUser loggedInUser = authenticationContext.getLoggedInUser(); return permissionManagerRef.get().hasPermission(GlobalPermissionKey.ADMINISTER, loggedInUser); }
@Deprecated /** * @deprecated Use {@link com.atlassian.jira.issue.fields.rest.json.WorklogBeanFactory#createBean(Worklog, ApplicationUser)} instead. Since v7.0. */ public static WorklogJsonBean getWorklog(final Worklog log, final JiraBaseUrls baseUrls, final UserManager userManager, final TimeTrackingConfiguration timeTrackingConfiguration) { ApplicationUser loggedInUser = ComponentAccessor.getComponent(JiraAuthenticationContext.class).getLoggedInUser(); return ComponentAccessor.getComponent(WorklogBeanFactory.class).createBean(log, loggedInUser); }
private boolean isDisplayable(ProjectTemplateModuleDescriptor moduleDescriptor) { //noinspection deprecation return moduleDescriptor.getCondition().shouldDisplay(ImmutableMap.of( JiraWebInterfaceManager.CONTEXT_KEY_HELPER, new JiraHelper(ExecutingHttpRequest.get()), JiraWebInterfaceManager.CONTEXT_KEY_USER, authenticationContext.getLoggedInUser() )); }