com.atlassian.jira.security.type
Class SingleUser

java.lang.Object
  extended by com.atlassian.jira.security.type.AbstractSecurityType
      extended by com.atlassian.jira.security.type.AbstractProjectsSecurityType
          extended by com.atlassian.jira.security.type.SingleUser
All Implemented Interfaces:
SchemeType, SecurityType

public class SingleUser
extends AbstractProjectsSecurityType


Field Summary
static String DESC
           
 
Constructor Summary
SingleUser(JiraAuthenticationContext jiraAuthenticationContext, UserManager userManager)
           
 
Method Summary
 boolean doValidation(String key, Map<String,String> parameters)
          Validates given input which in case of user is username
 void doValidation(String key, Map<String,String> parameters, JiraServiceContext jiraServiceContext)
           
 String getArgumentDisplay(String argument)
           
 String getDisplayName()
          Returns display name - i18ned admin.permission.types.single.user
 String getType()
          Always returns DESC.
 Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx, String argument)
          Returns a single element set that contains a User object found by the given user name.
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String argument)
          Always returns false;
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String argument, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
          Determines if the single user is the same as the current user.
 boolean hasPermission(Issue issue, String parameter)
          Determines if this permission type is satisfied for anonymous access.
 boolean hasPermission(Issue issue, String parameter, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
          Determines if this permission type is satisfied.
 boolean hasPermission(Project project, String argument)
          Determines if this permission type is satisfied for anonymous access.
 boolean hasPermission(Project project, String parameter, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
          Determines if this permission type is satisfied.
 
Methods inherited from class com.atlassian.jira.security.type.AbstractProjectsSecurityType
getQuery, getQuery, getQuery
 
Methods inherited from class com.atlassian.jira.security.type.AbstractSecurityType
isValidForPermission
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESC

public static final String DESC
See Also:
Constant Field Values
Constructor Detail

SingleUser

public SingleUser(JiraAuthenticationContext jiraAuthenticationContext,
                  UserManager userManager)
Method Detail

getDisplayName

public String getDisplayName()
Returns display name - i18ned admin.permission.types.single.user

Returns:
display name

getArgumentDisplay

public String getArgumentDisplay(String argument)
Specified by:
getArgumentDisplay in interface SecurityType
Overrides:
getArgumentDisplay in class AbstractSecurityType

getType

public String getType()
Always returns DESC.

Returns:
Always returns DESC.

doValidation

public void doValidation(String key,
                         Map<String,String> parameters,
                         JiraServiceContext jiraServiceContext)

doValidation

public boolean doValidation(String key,
                            Map<String,String> parameters)
Validates given input which in case of user is username

Parameters:
key -
parameters -
Returns:

hasPermission

public boolean hasPermission(org.ofbiz.core.entity.GenericValue entity,
                             String argument)
Always returns false;

Parameters:
entity - This parameter is ignored
argument - This parameter is ignored
Returns:
false

hasPermission

public boolean hasPermission(Project project,
                             String argument)
Description copied from interface: SchemeType
Determines if this permission type is satisfied for anonymous access.

Parameters:
project - This is the project that the security is being checked for
argument - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
Returns:
true if anonymous Users have this permission.

hasPermission

public boolean hasPermission(Issue issue,
                             String parameter)
Description copied from interface: SchemeType
Determines if this permission type is satisfied for anonymous access.

Parameters:
issue - This is the issue that the security is being checked for
parameter - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
Returns:
true if anonymous Users have this permission.

hasPermission

public boolean hasPermission(org.ofbiz.core.entity.GenericValue entity,
                             String argument,
                             com.atlassian.crowd.embedded.api.User user,
                             boolean issueCreation)
Determines if the single user is the same as the current user. If it is not then false is returned.

Parameters:
entity - Not needed for this implementation
argument - The user key that the check is based on
user - User to check the permission on. If it is null then the check is made on the current user
issueCreation - This parameter is ignored
Returns:
true if the user is the current user otherwise false
See Also:
AbstractIssueFieldSecurityType.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), AbstractIssueFieldSecurityType.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), ProjectLead.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), GroupDropdown.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String)

hasPermission

public boolean hasPermission(Project project,
                             String parameter,
                             com.atlassian.crowd.embedded.api.User user,
                             boolean issueCreation)
Description copied from interface: SchemeType
Determines if this permission type is satisfied.

Parameters:
project - This is the project that the security is being checked for
parameter - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
user - The user for whom the permission is being checked
issueCreation - Whether this permission is being checked during issue creation
Returns:
true if the given User has this permission.

hasPermission

public boolean hasPermission(Issue issue,
                             String parameter,
                             com.atlassian.crowd.embedded.api.User user,
                             boolean issueCreation)
Description copied from interface: SchemeType
Determines if this permission type is satisfied.

Parameters:
issue - This is the issue that the security is being checked for
parameter - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
user - The user for whom the permission is being checked
issueCreation - Whether this permission is being checked during issue creation
Returns:
true if the given User has this permission.

getUsers

public Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx,
                                                           String argument)
Returns a single element set that contains a User object found by the given user name.

Parameters:
ctx - permission context
argument - user key string
Returns:
single element set


Copyright © 2002-2014 Atlassian. All Rights Reserved.