@Override public boolean hasPermissionToPerformOperation() { return issueManager.isEditable(issue, user); }
@Override public boolean isIssueInEditableWorkflowState(Issue issue) { return issueManager.isEditable(issue); }
@Override public boolean isEditable(final Issue issue, final ApplicationUser user) { return issueManager.isEditable(issue, user); }
public boolean shouldDisplay(ApplicationUser user, Issue issue, JiraHelper jiraHelper) { return issueManager.isEditable(issue); }
boolean isIssueInEditableWorkflowState(Issue issue) { return issueManager.isEditable(issue); }
boolean isIssueInEditableWorkflowState(Issue issue) { return issueManager.isEditable(issue); }
@Override public boolean isEditable(final Issue issue) {return delegate.isEditable(issue);}
@Override public boolean isEditable(final Issue issue, final ApplicationUser user) {return delegate.isEditable(issue, user);}
public boolean isEditable() { if (getGenericValue() != null) return issueManager.isEditable(this); else return true; }
private boolean validateIssueEditable(@Nullable final ApplicationUser user, final Issue issue, final ErrorCollection errorCollection) { return processValidationResult(issueManager.isEditable(issue), "attachment.service.error.create.issue.non.editable", user, errorCollection); }
private boolean showEdit(Issue issue) { return issueManager.isEditable(issue, getDirectoryUser()); }
public boolean isWorkflowAllowsEdit(final Issue issue) { return getIssueManager().isEditable(issue); }
boolean hasPermissionToEdit(ApplicationUser user, Issue issue, I18nHelper i18n, ErrorCollection errors) { final boolean hasPermission = issueManager.isEditable(issue, user); if (!hasPermission) { errors.addErrorMessage(i18n.getText("editissue.error.no.edit.permission"), user == null ? Reason.NOT_LOGGED_IN : Reason.FORBIDDEN); } return hasPermission; }
private boolean canDeleteAttachment(Issue issue, Attachment attachment, ApplicationUser user) { return issueManager.isEditable(issue) && (permissionManager.hasPermission(Permissions.ATTACHMENT_DELETE_ALL, issue, user) || (permissionManager.hasPermission(Permissions.ATTACHMENT_DELETE_OWN, issue, user) && isUserAttachmentAuthor(attachment, user))); }
@Nonnull @Override public Map<String, Object> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem) { final Map<String, Object> velocityParameters = super.getVelocityParameters(issue, field, fieldLayoutItem); if (issue == null || issue.getId() == null) { velocityParameters.put("canEdit", Boolean.FALSE); } else { final Issue issueFromDb = issueManager.getIssueObject(issue.getId()); velocityParameters.put("canEdit", issueManager.isEditable(issueFromDb, authContext.getUser())); velocityParameters.put("labels", getValueFromIssue(field, issue)); } velocityParameters.put("fieldId", field.getId()); velocityParameters.put("i18n", authContext.getI18nHelper()); velocityParameters.put("field", field); velocityParameters.put("labelUtil", labelUtil); velocityParameters.put("issue", issue); velocityParameters.put("labelParser", new LabelParser()); return velocityParameters; }
public String getColumnViewHtml(final FieldLayoutItem fieldLayoutItem, final Map displayParams, final Issue issue) { final Map<String, Object> velocityParams = getVelocityParams(getAuthenticationContext().getI18nHelper(), displayParams, issue); velocityParams.put("labels", issue.getLabels()); velocityParams.put("labelUtil", getLabelUtil()); velocityParams.put("remoteUser", authenticationContext.getUser()); velocityParams.put("canEdit", issueManager.isEditable(issue, authenticationContext.getUser())); return renderTemplate("labels-columnview.vm", velocityParams); }
private List<IssueAction> getAllComments(final GetActionsRequest request) { final Issue issue = request.issue(); final ApplicationUser user = request.loggedInUser(); // Get the list of Comment objects for the given Issue that this user can see. final Collection<Comment> userComments = commentManager.getCommentsForUser(issue, user); // We need to turn these into CommentAction objects for display on the web. final List<IssueAction> commentActions = Lists.newArrayListWithCapacity(userComments.size()); // We want to do these checks ONCE. Doing them for each iteration of the loop below is very inefficient. boolean issueIsInEditableWorkflow = issueManager.isEditable(issue); // Allow issueIsInEditableWorkflow shortcut this check boolean canDeleteAllComments = issueIsInEditableWorkflow && commentPermissionManager.hasDeleteAllPermission(user, issue); // If you can delete all comments, then you can delete your own comments, and we can shortcut this check boolean canDeleteOwnComments = canDeleteAllComments || (issueIsInEditableWorkflow && commentPermissionManager.hasDeleteOwnPermission(user, issue)); boolean canEditAllComments = issueIsInEditableWorkflow && commentPermissionManager.hasEditAllPermission(user, issue); boolean canEditOwnComments = canEditAllComments || (issueIsInEditableWorkflow && commentPermissionManager.hasEditOwnPermission(user, issue)); for (final Comment comment : userComments) { boolean canDelete = canDeleteAllComments || (canDeleteOwnComments && commentManager.isUserCommentAuthor(user, comment)); boolean canEdit = canEditAllComments || (canEditOwnComments && commentManager.isUserCommentAuthor(user, comment)); commentActions.add(new CommentAction(descriptor, comment, canEdit, canDelete, false, rendererManager, fieldLayoutManager, dateTimeFormatter, commentFieldRenderer, commentPropertyService, jiraAuthenticationContext)); } return commentActions; }
return errors; if (!issueManager.isEditable(issue, user))
field.validateParams(this, this, this, getIssueObject(), getFieldScreenRendererLayoutItemForField(field)); if(!issueManager.isEditable(getIssueObject()))