com.atlassian.jira.issue.comments
Interface CommentPermissionManager

All Known Implementing Classes:
DefaultCommentPermissionManager

public interface CommentPermissionManager

A unified way of checking whether a user can see a comment or not


Method Summary
 boolean hasBrowsePermission(Comment comment, User user)
          Return true if the user can see the comment.
 boolean hasEditPermission(Comment comment, User user)
          Determines whether the given user has permission to edit the given comment.
 

Method Detail

hasBrowsePermission

boolean hasBrowsePermission(Comment comment,
                            User user)
Return true if the user can see the comment. It does not check if the user has the permission to see the issue the comment is attached to however.

Parameters:
comment - comment
user - user
Returns:
true if permmision is granted, false otherwise

hasEditPermission

boolean hasEditPermission(Comment comment,
                          User user)
Determines whether the given user has permission to edit the given comment. The user is granted permission if they have the Permissions.COMMENT_EDIT_ALL permission or the Permissions.COMMENT_EDIT_OWN permission in case the user is the author of the given comment.

NOTE: The permissions will be determined by the permission scheme associated to the project the comment is a part of and the entries for the above mentioned permissions.

Parameters:
comment - comment
user - user
Returns:
true if permmision is granted, false otherwise


Copyright © 2002-2008 Atlassian. All Rights Reserved.