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)
           
 
Method Summary
 boolean doValidation(String key, Map 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 getUsers(PermissionContext ctx, String username)
          Returns a single element set that contains a User object found by the given username.
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String argument)
          Always returns false;
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String argument, 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)
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 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,
                             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 getUsers(PermissionContext ctx,
                    String username)
Returns a single element set that contains a User object found by the given username.

Parameters:
ctx - permission context
username - username
Returns:
single element set


Copyright © 2002-2009 Atlassian. All Rights Reserved.