com.atlassian.jira.sharing.type
Class ProjectShareTypeValidator

java.lang.Object
  extended by com.atlassian.jira.sharing.type.ProjectShareTypeValidator
All Implemented Interfaces:
ShareTypeValidator

public class ProjectShareTypeValidator
extends java.lang.Object
implements ShareTypeValidator

Validator for ProjectShareType

Since:
v3.13

Field Summary
 
Fields inherited from interface com.atlassian.jira.sharing.type.ShareTypeValidator
ERROR_KEY
 
Constructor Summary
ProjectShareTypeValidator(PermissionManager permissionManager, ProjectManager projectManager, ProjectRoleManager projectRoleManager)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectShareTypeValidator

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

checkSharePermission

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.

Specified by:
checkSharePermission in interface ShareTypeValidator
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.

checkSearchParameter

public boolean checkSearchParameter(JiraServiceContext serviceCtx,
                                    ShareTypeSearchParameter searchParameter)
Description copied from interface: ShareTypeValidator
Check to see if the passed SearchParameter is valid for the ShareType.

Specified by:
checkSearchParameter in interface ShareTypeValidator
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.


Copyright © 2002-2010 Atlassian. All Rights Reserved.