|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.comments.DefaultCommentPermissionManager
public class DefaultCommentPermissionManager
This permission manager is responsible to check and grant browse and edit permissions to users over issue comments.
Constructor Summary | |
---|---|
DefaultCommentPermissionManager(ProjectRoleManager projectRoleManager,
PermissionManager permissionManager)
|
Method Summary | |
---|---|
boolean |
hasBrowsePermission(Comment comment,
User user)
Determines whether the user can see given comment. |
boolean |
hasDeleteAllPermission(User user,
Issue issue)
Returns true if the given User can delete all comments for the given Issue. |
boolean |
hasDeleteOwnPermission(User user,
Issue issue)
Returns true if the given User can delete her own comments in the given Issue. |
boolean |
hasEditAllPermission(User user,
Issue issue)
Returns true if user has permission to edit all comments in the given Issue. |
boolean |
hasEditOwnPermission(User user,
Issue issue)
Returns true if user has permission to edit her own comments in the given Issue. |
boolean |
hasEditPermission(Comment comment,
User user)
Determines whether the user can edit given comment. |
boolean |
isUserCommentAuthor(User user,
Comment comment)
Returns true if the given user is the author of the given comment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultCommentPermissionManager(ProjectRoleManager projectRoleManager, PermissionManager permissionManager)
Method Detail |
---|
public boolean hasBrowsePermission(Comment comment, User user)
hasBrowsePermission
in interface CommentPermissionManager
comment
- commentuser
- user
public boolean hasEditPermission(Comment comment, User user)
hasEditPermission
in interface CommentPermissionManager
comment
- comment to edituser
- user
public boolean isUserCommentAuthor(User user, Comment comment)
CommentPermissionManager
If the given Comment has a null author, this represents that it was created anonymously, and no-one is the author (returns false). If the given User is null, then this represents that the current user is anonymous, and the method will always return false.
isUserCommentAuthor
in interface CommentPermissionManager
user
- The User. Can be null to represent current user is not logged in (anonymous).comment
- The Comment. Cannot be null.
public boolean hasEditAllPermission(User user, Issue issue)
CommentPermissionManager
hasEditAllPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasEditOwnPermission(User user, Issue issue)
CommentPermissionManager
hasEditOwnPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasDeleteAllPermission(User user, Issue issue)
CommentPermissionManager
hasDeleteAllPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasDeleteOwnPermission(User user, Issue issue)
CommentPermissionManager
hasDeleteOwnPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |