|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.security.util.GroupSelectorUtils
public class GroupSelectorUtils
Hacky methods to support mapping a display name to a group name. A "display" name is a user-friendly equivalent of a regular group name, eg. "JIRA Developers" instead of "jira-developers". In addition, a group name ("Admins") may resolve to multiple groups ("jira-admins, qa-admins" etc).
This code is used in groupnames.jsp,
GroupCF
and InGroupCFCondition
Constructor Summary | |
---|---|
GroupSelectorUtils(org.ofbiz.core.entity.GenericDelegator genericDelegator,
FieldManager fieldManager,
UserUtil userUtil,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
java.util.List |
getCustomFieldsSpecifyingGroups()
Get all custom fields that could possibly be identifying a group. |
java.lang.String |
getGroupDisplayName(com.opensymphony.user.Group group)
Deprecated. since v3.8 this is a very short term method as it will not work with external User/Group management. |
java.util.Set |
getGroups(java.lang.Object cfValue)
Given an object (usually a custom field value) find the associated group. |
java.util.Set |
getGroupsFromDisplayName(java.lang.String groupDisplayName)
Deprecated. since v3.8 this is a very short term method as it will not work with external User/Group management. |
java.util.Set |
getUsers(Issue issue,
java.lang.String customFieldId)
Get users from a group chosen by a Group Selector custom field, in a certain issue. |
boolean |
isUserInCustomFieldGroup(Issue issue,
CustomField field,
com.opensymphony.user.User user)
Determines if a user is a member of a group specified by a custom field value. |
void |
onClearCache(ClearCacheEvent event)
|
java.lang.String |
printGroups(java.util.Collection groups)
Print a comma-separated list of groups. |
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
boolean |
updateGroupName(com.opensymphony.user.Group group,
java.lang.String oldVal,
java.lang.String newVal)
Deprecated. since v3.8 this is a very short term method as it will not work with external User/Group management. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupSelectorUtils(org.ofbiz.core.entity.GenericDelegator genericDelegator, FieldManager fieldManager, UserUtil userUtil, com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail |
---|
public void start() throws java.lang.Exception
Startable
start
in interface Startable
java.lang.Exception
- Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public java.util.Set getUsers(Issue issue, java.lang.String customFieldId)
issue
- customFieldId
- Id of GroupSelectorField
.
User
s.public java.util.List getCustomFieldsSpecifyingGroups()
public boolean isUserInCustomFieldGroup(Issue issue, CustomField field, com.opensymphony.user.User user)
issue
- The current issuefield
- The custom field specifying the group(s). Eg. a select-list.user
- The user we wish to check for
public java.util.Set getGroups(java.lang.Object cfValue)
cfValue
- A String
(eg. "JIRA Developers" or "jira-developers") Group
or Collection
of String
s or Group
s.
Group
s.public java.lang.String printGroups(java.util.Collection groups)
public java.util.Set getGroupsFromDisplayName(java.lang.String groupDisplayName) throws org.ofbiz.core.entity.GenericEntityException
groupDisplayName
- Eg. "JIRA Developers"
Group
s, eg. [jira-developers], or null if none exists for the given display name.
org.ofbiz.core.entity.GenericEntityException
public final java.lang.String getGroupDisplayName(com.opensymphony.user.Group group) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
public boolean updateGroupName(com.opensymphony.user.Group group, java.lang.String oldVal, java.lang.String newVal) throws org.ofbiz.core.entity.GenericEntityException
group
- Group to updateoldVal
- The old value, if any (can be null)newVal
- New display name
org.ofbiz.core.entity.GenericEntityException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |