Package com.atlassian.jira.bc.issue.util
Class DefaultVisibilityValidator
java.lang.Object
com.atlassian.jira.bc.issue.util.DefaultVisibilityValidator
- All Implemented Interfaces:
VisibilityValidator
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultVisibilityValidator(ApplicationProperties applicationProperties, JiraAuthenticationContext jiraAuthenticationContext, ProjectRoleManager projectRoleManager, GroupManager groupManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if group visibility restrictions are currently enabled in JIRA.booleanDetermines if project role visibility restrictions are currently enabled in JIRA.booleanisValidVisibilityData(JiraServiceContext jiraServiceContext, String i18nPrefix, Issue issue, Visibility visibility) This will validate that the passed in group level and project role level id will constitute a valid visibility restriction.
-
Constructor Details
-
DefaultVisibilityValidator
public DefaultVisibilityValidator(ApplicationProperties applicationProperties, JiraAuthenticationContext jiraAuthenticationContext, ProjectRoleManager projectRoleManager, GroupManager groupManager)
-
-
Method Details
-
isValidVisibilityData
public boolean isValidVisibilityData(JiraServiceContext jiraServiceContext, String i18nPrefix, Issue issue, Visibility visibility) Description copied from interface:VisibilityValidatorThis 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:
isValidVisibilityDatain interfaceVisibilityValidator- Parameters:
jiraServiceContext- containing the user who wishes to apply the restriction and the errorCollectioni18nPrefix- the prefix for the I18N messages that will be added to the error collection.issue- theIssueyou wish to associate the element that will be restricted with. This can not be null.visibility- defines visibility of the comment- Returns:
- true if the visibility data is valid, false otherwise.
-
isGroupVisibilityEnabled
public boolean isGroupVisibilityEnabled()Description copied from interface:VisibilityValidatorDetermines if group visibility restrictions are currently enabled in JIRA.- Specified by:
isGroupVisibilityEnabledin interfaceVisibilityValidator- Returns:
- true if enabled, false otherwise.
-
isProjectRoleVisibilityEnabled
public boolean isProjectRoleVisibilityEnabled()Description copied from interface:VisibilityValidatorDetermines if project role visibility restrictions are currently enabled in JIRA.- Specified by:
isProjectRoleVisibilityEnabledin interfaceVisibilityValidator- Returns:
- true if enabled, false otherwise.
-