@PublicApi public class UserFilter extends Object
If isEnabled() is false, then it always refers to all active users.
If isEnabled() is true, it's subject to the restrictions from getGroups()
and getRoleIds()
.
Current implementation supports filters by groups and/or project roles. The filters are OR-ed, i.e., if 2 group filters and 3 project role filters are specified, the final set of users allowed is the union of the 5 sets of users from the 5 filters. If no filters are specified and isEnabled() is true, no users are allowed.
Modifier and Type | Field and Description |
---|---|
static UserFilter |
DISABLED |
static UserFilter |
ENABLED_NO_USERS |
Constructor and Description |
---|
UserFilter(boolean enabled,
Collection<Long> roleIds,
Collection<String> groups) |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getGroups()
This value is only considered if
isEnabled() returns true. |
Set<Long> |
getRoleIds()
This value is only considered if
isEnabled() returns true. |
boolean |
isEnabled() |
public static final UserFilter DISABLED
public static final UserFilter ENABLED_NO_USERS
public UserFilter(boolean enabled, Collection<Long> roleIds, Collection<String> groups)
public boolean isEnabled()
public Set<String> getGroups()
isEnabled()
returns true.
If null or empty, it means NO users are allowed from group restriction point of view.
Note that some users might still be allowed due to project role based restriction. getRoleIds()
If not empty, it means only users from the groups are allowed. Note that some other users might still be allowed due to project role based restriction.
public Set<Long> getRoleIds()
isEnabled()
returns true.
If null or empty, it means NO users are allowed from project role restriction point of view.
Note that some users might still be allowed due to group based restriction. getGroups()
If not empty, it means only users from the project roles are allowed. Note that some other users might still be allowed due to group based restriction.
Copyright © 2002-2021 Atlassian. All Rights Reserved.