com.atlassian.jira.bc.issue.util
Class DefaultVisibilityValidator

java.lang.Object
  extended by com.atlassian.jira.bc.issue.util.DefaultVisibilityValidator
All Implemented Interfaces:
VisibilityValidator

public class DefaultVisibilityValidator
extends java.lang.Object
implements VisibilityValidator

Used to validate things like Comment's and Worklog's group or project role visiblity restrictions.


Constructor Summary
DefaultVisibilityValidator(ApplicationProperties applicationProperties, JiraAuthenticationContext jiraAuthenticationContext, ProjectRoleManager projectRoleManager)
           
 
Method Summary
 boolean isGroupVisiblityEnabled()
          Determines if group visibility restrictions are currently enabled in JIRA.
 boolean isProjectRoleVisiblityEnabled()
          Determines if project role visibility restrictions are currently enabled in JIRA.
 boolean isValidVisibilityData(JiraServiceContext jiraServiceContext, java.lang.String i18nPrefix, Issue issue, java.lang.String groupLevel, java.lang.String roleLevelId)
          This will validate that the passed in group level and project role level id will constitute a valid visibility restriction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultVisibilityValidator

public DefaultVisibilityValidator(ApplicationProperties applicationProperties,
                                  JiraAuthenticationContext jiraAuthenticationContext,
                                  ProjectRoleManager projectRoleManager)
Method Detail

isValidVisibilityData

public boolean isValidVisibilityData(JiraServiceContext jiraServiceContext,
                                     java.lang.String i18nPrefix,
                                     Issue issue,
                                     java.lang.String groupLevel,
                                     java.lang.String roleLevelId)
Description copied from interface: VisibilityValidator
This will validate that the passed in group level and project role level id will constitute a valid visibility restriction. You can not specify both a group and role level. The group or role must exist in JIRA and the user performing this operation must be a member of the group or role. All errors will be added in human-readable form via the I18N key prefixed with the passed in prefix.

Specified by:
isValidVisibilityData in interface VisibilityValidator
Parameters:
jiraServiceContext - containing the user who wishes to apply the restriction and the errorCollection
i18nPrefix - the prefix for the I18N messages that will be added to the error collection.
issue - The Issue you wish to associate the element that will be restricted with. This can not be null.
groupLevel - The group level visibility of the comment (null if roleLevelId specified)
roleLevelId - The role level visibility id of the comment (null if groupLevel specified)
Returns:
true if the visibility data is valid, false otherwise.

isGroupVisiblityEnabled

public boolean isGroupVisiblityEnabled()
Description copied from interface: VisibilityValidator
Determines if group visibility restrictions are currently enabled in JIRA.

Specified by:
isGroupVisiblityEnabled in interface VisibilityValidator
Returns:
true if enabled, false otherwise.

isProjectRoleVisiblityEnabled

public boolean isProjectRoleVisiblityEnabled()
Description copied from interface: VisibilityValidator
Determines if project role visibility restrictions are currently enabled in JIRA.

Specified by:
isProjectRoleVisiblityEnabled in interface VisibilityValidator
Returns:
true if enabled, false otherwise.


Copyright © 2002-2011 Atlassian. All Rights Reserved.