|
||||||||||
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
Used to check user commenting permissions
Constructor Summary | |
---|---|
DefaultCommentPermissionManager(ProjectRoleManager projectRoleManager,
PermissionManager permissionManager,
GroupManager groupManager)
|
Method Summary | |
---|---|
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) 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. |
boolean |
hasBrowsePermission(com.atlassian.crowd.embedded.api.User user,
Comment comment)
|
boolean |
hasDeleteAllPermission(ApplicationUser user,
Issue issue)
Returns true if the given User can delete all comments for the given Issue. |
boolean |
hasDeleteAllPermission(com.atlassian.crowd.embedded.api.User user,
Issue issue)
|
boolean |
hasDeleteOwnPermission(ApplicationUser user,
Issue issue)
Returns true if the given User can delete her own comments in the given Issue. |
boolean |
hasDeleteOwnPermission(com.atlassian.crowd.embedded.api.User user,
Issue issue)
|
boolean |
hasEditAllPermission(ApplicationUser user,
Issue issue)
Returns true if user has permission to edit all comments in the given Issue. |
boolean |
hasEditAllPermission(com.atlassian.crowd.embedded.api.User user,
Issue issue)
|
boolean |
hasEditOwnPermission(ApplicationUser user,
Issue issue)
Returns true if user has permission to edit her own comments in the given Issue. |
boolean |
hasEditOwnPermission(com.atlassian.crowd.embedded.api.User user,
Issue issue)
|
boolean |
hasEditPermission(ApplicationUser user,
Comment comment)
Determines whether the user can edit given comment. |
boolean |
hasEditPermission(com.atlassian.crowd.embedded.api.User user,
Comment comment)
|
boolean |
isUserCommentAuthor(ApplicationUser user,
Comment comment)
Returns true if the given user is the author of the given comment. |
boolean |
isUserCommentAuthor(com.atlassian.crowd.embedded.api.User user,
Comment 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, GroupManager groupManager)
Method Detail |
---|
public boolean hasBrowsePermission(ApplicationUser user, Comment comment)
hasBrowsePermission
in interface CommentPermissionManager
user
- application usercomment
- comment
public boolean hasBrowsePermission(com.atlassian.crowd.embedded.api.User user, Comment comment)
hasBrowsePermission
in interface CommentPermissionManager
user
- usercomment
- comment
public boolean hasEditPermission(ApplicationUser user, Comment comment)
hasEditPermission
in interface CommentPermissionManager
user
- usercomment
- comment to edit
public boolean hasEditPermission(com.atlassian.crowd.embedded.api.User user, Comment comment)
hasEditPermission
in interface CommentPermissionManager
user
- usercomment
- comment
public boolean isUserCommentAuthor(ApplicationUser 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 isUserCommentAuthor(com.atlassian.crowd.embedded.api.User user, Comment comment)
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(ApplicationUser user, Issue issue)
CommentPermissionManager
hasEditAllPermission
in interface CommentPermissionManager
user
- ApplicationUser
. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasEditAllPermission(com.atlassian.crowd.embedded.api.User user, Issue issue)
hasEditAllPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasEditOwnPermission(ApplicationUser user, Issue issue)
CommentPermissionManager
hasEditOwnPermission
in interface CommentPermissionManager
user
- ApplicationUser
. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasEditOwnPermission(com.atlassian.crowd.embedded.api.User user, Issue issue)
hasEditOwnPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasDeleteAllPermission(ApplicationUser 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 hasDeleteAllPermission(com.atlassian.crowd.embedded.api.User user, Issue issue)
hasDeleteAllPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasDeleteOwnPermission(ApplicationUser user, Issue issue)
CommentPermissionManager
hasDeleteOwnPermission
in interface CommentPermissionManager
user
- User. A null value represents an anonymous User.issue
- Issue. Must not be null.
public boolean hasDeleteOwnPermission(com.atlassian.crowd.embedded.api.User user, Issue issue)
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 |