com.atlassian.jira.security.type
Class GroupDropdown

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.GroupDropdown
All Implemented Interfaces:
SchemeType, SecurityType

public class GroupDropdown
extends AbstractProjectsSecurityType


Field Summary
static String DESC
           
 
Constructor Summary
GroupDropdown(JiraAuthenticationContext jiraAuthenticationContext)
           
 
Method Summary
 void doValidation(String key, Map parameters, JiraServiceContext jiraServiceContext)
           
 String getDisplayName()
           
 List getGroups()
           
 String getType()
           
 Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx, String groupName)
          Returns a list of Users represented by a security type instance.
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String group)
          If there is no user passed to a security type then they have the permission if there is no group set
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String groupName, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
          Determines if the use is part of a group that has the permission
 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 group)
          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
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

GroupDropdown

public GroupDropdown(JiraAuthenticationContext jiraAuthenticationContext)
Method Detail

getDisplayName

public String getDisplayName()

getType

public String getType()

getGroups

public List getGroups()

hasPermission

public boolean hasPermission(org.ofbiz.core.entity.GenericValue entity,
                             String group)
If there is no user passed to a security type then they have the permission if there is no group set

Parameters:
entity - - not used
group - The group. If it is null then it is Anyone
Returns:
true if anonymous Users have this permission.
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), SingleUser.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String)

hasPermission

public boolean hasPermission(Project project,
                             String group)
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
group - 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 groupName,
                             com.atlassian.crowd.embedded.api.User user,
                             boolean issueCreation)
Determines if the use is part of a group that has the permission

Parameters:
entity - not used
groupName - The group. If it is null then it is Anyone
user - The user to check if they are in the group, must not be null
issueCreation - not used
Returns:
true if the given User has this permission.
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), SingleUser.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.

doValidation

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

getUsers

public Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx,
                                                           String groupName)
Description copied from interface: SecurityType
Returns a list of Users represented by a security type instance. The collection must not contain any nulls.

Parameters:
ctx - The current issue and project
groupName - Instance value, eg. a group name, user name, custom field id
Returns:
A set of Users.


Copyright © 2002-2013 Atlassian. All Rights Reserved.