|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.security.groups.MockGroupManager
public class MockGroupManager
Constructor Summary | |
---|---|
MockGroupManager()
|
Method Summary | |
---|---|
void |
addGroup(String groupName)
|
void |
addMember(String groupName,
String userName)
|
void |
addUserToGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
Adds a user as a member of a group. |
com.atlassian.crowd.embedded.api.Group |
createGroup(String groupName)
Create a group with the given name. |
Collection<com.atlassian.crowd.embedded.api.Group> |
getAllGroups()
Get all groups. |
Collection<com.atlassian.crowd.embedded.api.User> |
getDirectUsersInGroup(com.atlassian.crowd.embedded.api.Group group)
Returns all the users that are direct members of the group. |
com.atlassian.crowd.embedded.api.Group |
getGroup(String groupname)
Returns the Group for this groupName, else null if no such Group exists. |
com.atlassian.crowd.embedded.api.Group |
getGroupEvenWhenUnknown(String groupName)
Returns the Group for this groupName, if no such Group exists then a proxy unknown immutable Group object is returned. |
Collection<String> |
getGroupNamesForUser(String userName)
Returns the names of all the groups that the given user belongs to. |
Collection<String> |
getGroupNamesForUser(com.atlassian.crowd.embedded.api.User user)
Returns the names of all the groups that the given user belongs to. |
com.atlassian.crowd.embedded.api.Group |
getGroupObject(String groupName)
Returns the Group for this groupName, else null if no such Group exists. |
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroupsForUser(String userName)
Returns all the groups that the given user belongs to. |
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroupsForUser(com.atlassian.crowd.embedded.api.User user)
Returns all the groups that the given user belongs to. |
Collection<String> |
getUserNamesInGroup(com.atlassian.crowd.embedded.api.Group group)
Returns the names of all the users in a group. |
Collection<String> |
getUserNamesInGroup(String groupName)
Returns the names of all the users in a group. |
Collection<com.atlassian.crowd.embedded.api.User> |
getUsersInGroup(com.atlassian.crowd.embedded.api.Group group)
Returns all the users in a group. |
Collection<com.atlassian.crowd.embedded.api.User> |
getUsersInGroup(String groupName)
Returns all the users in a group. |
boolean |
groupExists(String groupname)
Returns true if the given group name exists. |
boolean |
isUserInGroup(String username,
String groupname)
Returns true if the user is a member of the group. |
boolean |
isUserInGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
Returns true if the user is a member of the group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockGroupManager()
Method Detail |
---|
public Collection<com.atlassian.crowd.embedded.api.Group> getAllGroups()
GroupManager
getAllGroups
in interface GroupManager
public boolean groupExists(String groupname)
GroupManager
true
if the given group name exists.
groupExists
in interface GroupManager
groupname
- The group name.
true
if the given group name exists.public com.atlassian.crowd.embedded.api.Group createGroup(String groupName)
GroupManager
createGroup
in interface GroupManager
groupName
- The group name.
public com.atlassian.crowd.embedded.api.Group getGroup(String groupname)
GroupManager
com.opensymphony.user.Group
. This
class has now been removed from the JIRA API, meaning that the 5.0 version is not binary or source compatible
with earlier versions.
getGroup
in interface GroupManager
groupname
- The group name.
public com.atlassian.crowd.embedded.api.Group getGroupEvenWhenUnknown(String groupName)
GroupManager
getGroupEvenWhenUnknown
in interface GroupManager
groupName
- The group name.
public com.atlassian.crowd.embedded.api.Group getGroupObject(String groupName)
GroupManager
GroupManager.getGroup(String)
.
getGroupObject
in interface GroupManager
groupName
- The group name.
GroupManager.getGroup(String)
public boolean isUserInGroup(String username, String groupname)
GroupManager
true
if the user is a member of the group.
Note that if the username or groupname is null, then it will return false.
isUserInGroup
in interface GroupManager
username
- user to inspect.groupname
- group to inspect.
true
if and only if the user is a direct or indirect (nested) member of the group.GroupManager.isUserInGroup(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.Group)
public boolean isUserInGroup(com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.Group group)
GroupManager
true
if the user is a member of the group.
Note that if the User or Group object is null, then it will return false. This was done to retain consistency with the old OSUser behaviour of User.inGroup() and Group.containsUser()
isUserInGroup
in interface GroupManager
user
- user to inspect.group
- group to inspect.
true
if and only if the user is a direct or indirect (nested) member of the group.GroupManager.isUserInGroup(String, String)
public Collection<com.atlassian.crowd.embedded.api.User> getUsersInGroup(String groupName)
GroupManager
getUsersInGroup
in interface GroupManager
groupName
- The group
#getUsersInGroup(Group)}
public Collection<com.atlassian.crowd.embedded.api.User> getUsersInGroup(com.atlassian.crowd.embedded.api.Group group)
GroupManager
getUsersInGroup
in interface GroupManager
group
- The group
#getUsersInGroup(String)}
public Collection<String> getUserNamesInGroup(com.atlassian.crowd.embedded.api.Group group)
GroupManager
getUserNamesInGroup
in interface GroupManager
group
- The group
#getUsersInGroup(Group)}
public Collection<String> getUserNamesInGroup(String groupName)
GroupManager
getUserNamesInGroup
in interface GroupManager
groupName
- The group
#getUsersInGroup(String)}
public Collection<com.atlassian.crowd.embedded.api.User> getDirectUsersInGroup(com.atlassian.crowd.embedded.api.Group group)
GroupManager
getDirectUsersInGroup
in interface GroupManager
group
- The group
#getUsersInGroup(String)}
public Collection<com.atlassian.crowd.embedded.api.Group> getGroupsForUser(String userName)
GroupManager
getGroupsForUser
in interface GroupManager
userName
- The user
GroupManager.getGroupNamesForUser(String)
public Collection<com.atlassian.crowd.embedded.api.Group> getGroupsForUser(com.atlassian.crowd.embedded.api.User user)
GroupManager
getGroupsForUser
in interface GroupManager
user
- The user
GroupManager.getGroupNamesForUser(String)
public Collection<String> getGroupNamesForUser(String userName)
GroupManager
getGroupNamesForUser
in interface GroupManager
userName
- The user
GroupManager.getGroupsForUser(String)
public Collection<String> getGroupNamesForUser(com.atlassian.crowd.embedded.api.User user)
GroupManager
getGroupNamesForUser
in interface GroupManager
user
- The user
GroupManager.getGroupsForUser(String)
public void addUserToGroup(com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.Group group)
GroupManager
addUserToGroup
in interface GroupManager
user
- The user that will become a member of the group.group
- The group that will gain a new member.public void addGroup(String groupName)
public void addMember(String groupName, String userName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |