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)
           
 void doValidation(String key, Map parameters, JiraServiceContext jiraServiceContext)
           
 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 username)
          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.
 
Methods inherited from class com.atlassian.jira.security.type.AbstractProjectsSecurityType
getQuery, getQuery
 
Methods inherited from class com.atlassian.jira.security.type.AbstractSecurityType
getArgumentDisplay, 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

getType

public String getType()
Always returns DESC.

Returns:
Always returns DESC.

doValidation

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

doValidation

public boolean doValidation(String key,
                            Map<String,String> parameters)

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(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 name 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)

getUsers

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

Parameters:
ctx - permission context
username - user name string
Returns:
single element set


Copyright © 2002-2012 Atlassian. All Rights Reserved.