public class

ProjectShareTypeValidator

extends Object
implements ShareTypeValidator
java.lang.Object
   ↳ com.atlassian.jira.sharing.type.ProjectShareTypeValidator

Class Overview

Validator for ProjectShareType

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.sharing.type.ShareTypeValidator
Public Constructors
ProjectShareTypeValidator(PermissionManager permissionManager, ProjectManager projectManager, ProjectRoleManager projectRoleManager)
Public Methods
boolean checkSearchParameter(JiraServiceContext serviceCtx, ShareTypeSearchParameter searchParameter)
Check to see if the passed SearchParameter is valid for the ShareType.
boolean checkSharePermission(JiraServiceContext ctx, SharePermission permission)
checks that the user has browse permission for the given project if no role is given, else checks that the user is part of that role for the given project.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.sharing.type.ShareTypeValidator

Public Constructors

public ProjectShareTypeValidator (PermissionManager permissionManager, ProjectManager projectManager, ProjectRoleManager projectRoleManager)

Public Methods

public boolean checkSearchParameter (JiraServiceContext serviceCtx, ShareTypeSearchParameter searchParameter)

Check to see if the passed SearchParameter is valid for the ShareType.

Parameters
serviceCtx Context containing the user that is to store the SharePermission, the i18n bean and an ErrorCollection
searchParameter the parameter is check.
Returns
  • true if the parameter is valid or false otherwise.

public boolean checkSharePermission (JiraServiceContext ctx, SharePermission permission)

checks that the user has browse permission for the given project if no role is given, else checks that the user is part of that role for the given project.

Parameters
ctx The service context that contains the user trying to store permissions, the i18n bean and the error collection
permission The permission to check. Must have project, and role is optional
Returns
  • true if the usr passes the above criteria, false otherwise.