public class DefaultCommentPermissionManager extends Object implements CommentPermissionManager
| Constructor and Description |
|---|
DefaultCommentPermissionManager(ProjectRoleManager projectRoleManager,
PermissionManager permissionManager,
GroupManager groupManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasBrowsePermission(ApplicationUser user,
Comment comment)
Determines whether the user can see given comment, or is prevented by restrictions on the visibility of the
comment (either group- or Project Role-based)
|
boolean |
hasDeleteAllPermission(ApplicationUser user,
Issue issue)
Returns true if the given User can delete all comments for the given Issue.
|
boolean |
hasDeleteOwnPermission(ApplicationUser user,
Issue issue)
Returns true if the given User can delete her own comments in the given Issue.
|
boolean |
hasEditAllPermission(ApplicationUser user,
Issue issue)
Returns true if user has permission to edit all comments in the given Issue.
|
boolean |
hasEditOwnPermission(ApplicationUser user,
Issue issue)
Returns true if user has permission to edit her own comments in the given Issue.
|
boolean |
hasEditPermission(ApplicationUser user,
Comment comment)
Determines whether the user can edit given comment.
|
boolean |
isUserCommentAuthor(ApplicationUser user,
Comment comment)
Returns true if the given user is the author of the given comment.
|
public DefaultCommentPermissionManager(ProjectRoleManager projectRoleManager, PermissionManager permissionManager, GroupManager groupManager)
public boolean hasBrowsePermission(ApplicationUser user, Comment comment)
The User can always see the comment if the comment does not have restricted visibility, otherwise only if the user is in either comments group or project role visibility level.
hasBrowsePermission in interface CommentPermissionManageruser - application usercomment - commentpublic boolean hasEditPermission(ApplicationUser user, Comment comment)
The User can edit the given comment if he or she can edit all comments for the issue, or is the author and has "edit own comments" permission.
hasEditPermission in interface CommentPermissionManageruser - usercomment - comment to editpublic boolean isUserCommentAuthor(ApplicationUser user, Comment comment)
CommentPermissionManagerIf 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 CommentPermissionManageruser - The User. Can be null to represent current user is not logged in (anonymous).comment - The Comment. Cannot be null.public boolean hasEditAllPermission(ApplicationUser user, Issue issue)
CommentPermissionManagerNOTE: This method does not check whether the Issue the comment belongs to is in an editable workflow state.
hasEditAllPermission in interface CommentPermissionManageruser - ApplicationUser. A null value represents an anonymous User.issue - Issue. Must not be null.public boolean hasEditOwnPermission(ApplicationUser user, Issue issue)
CommentPermissionManagerNOTE: This method does not check whether the Issue the comment belongs to is in an editable workflow state.
hasEditOwnPermission in interface CommentPermissionManageruser - ApplicationUser. A null value represents an anonymous User.issue - Issue. Must not be null.public boolean hasDeleteAllPermission(ApplicationUser user, Issue issue)
CommentPermissionManagerNOTE: This method does not check whether the Issue the comment belongs to is in an editable workflow state.
hasDeleteAllPermission in interface CommentPermissionManageruser - User. A null value represents an anonymous User.issue - Issue. Must not be null.public boolean hasDeleteOwnPermission(ApplicationUser user, Issue issue)
CommentPermissionManagerNOTE: This method does not check whether the Issue the comment belongs to is in an editable workflow state.
hasDeleteOwnPermission in interface CommentPermissionManageruser - User. A null value represents an anonymous User.issue - Issue. Must not be null.Copyright © 2002-2019 Atlassian. All Rights Reserved.