public interface GroupsHandler
extends org.cyclos.impl.users.GroupListViewFactoryAccessor
BasicGroupListViewFactoryAccessor.accessibles()GroupListViewFactoryAccessor.ads()#users(boolean)#directory(boolean)GroupVisibility associated to the user use
visibles() as a way to get the correct factory accessor.all() for the right factory (we
have support to include disabled groups only for the accessible collection)GroupListViewFactoryAccessor,
GroupListViewFactory,
GroupListView,
GroupList| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.collections4.BidiMap<java.lang.Class<? extends BasicGroup>,java.lang.Class<? extends BasicGroupVO>> |
VO_MAPPINGS |
| Modifier and Type | Method and Description |
|---|---|
org.cyclos.impl.users.GroupListViewFactory |
all()
Only for administrators, for members it returns the same as
BasicGroupListViewFactoryAccessor.accessibles(). |
static java.util.Set<? extends BasicGroup> |
doFlatten(java.util.Collection<? extends BasicGroup> basicGroups,
boolean includeDisabled,
boolean includeGroupset)
Expands the given groups / group sets into a set of groups / group sets (depending on a flag).
|
static java.util.Set<Group> |
doFlattenGroups(java.util.Collection<? extends BasicGroup> basicGroups,
boolean includeDisabledGroups) |
java.util.Set<Group> |
flatten(java.util.Collection<? extends BasicGroup> basicGroups)
Expands the given groups / group sets into a set of groups.
|
java.util.Set<Group> |
flattenVOs(java.util.Collection<? extends BasicGroupVO> basicGroups)
See
flatten(Collection), but takes the VO's as input. |
java.util.Set<Group> |
flattenVOs(java.util.Collection<? extends BasicGroupVO> basicGroupVOs,
boolean includeDisabledGroupsOfGroupset)
See
flatten(Collection), but takes the VO's as input, and includes disabled groups depending on the
boolean parameter. |
java.util.Set<AdminGroup> |
getAccessibleGlobalGroups()
Returns the accessible admin global groups the logged user can access.
|
java.util.Set<UserGroup> |
getAccessibleUserGroups(User user)
Returns the accessible groups with type=USER and enabled=true for the given user
|
GroupVisibility |
getGroupVisibility(boolean overBrokered)
Returns the
GroupVisibility for the current user. |
java.util.List<InitialGroupVO> |
getPossiblePublicInitialGroups()
Returns the groups either a public user may use to register himself, or a broker to register a new member
|
java.util.Set<Group> |
getPossibleRegistrationGroups(boolean onlyUserGroups,
boolean asMember)
Returns the possible groups for registering new users for the logged user:
if admin: all visible groups.
|
java.util.List<InitialGroupVO> |
getPossibleRegistrationInitialGroups(boolean asMember)
Same as
#getPossibleRegistrationGroups(false, boolean) but in case of a
broker registering "as member" or a member the name and description are those set for registration. |
java.util.Set<BasicGroup> |
getViewProfileOnGroups()
Returns the groups the logged user can view profile of users
|
org.cyclos.impl.users.GroupListViewFactory |
viewFactory(java.util.Collection<? extends BasicGroup> basicGroups)
Return a view factory for the given set of basic groups.
|
org.cyclos.impl.users.GroupListViewFactory |
viewFactory(org.cyclos.impl.users.GroupList list)
Returns a view factory for working with brokeredMembers = false and without applying group visibility.
|
org.cyclos.impl.users.GroupListViewFactoryAccessor |
visibles()
This method must be used to send the available groups to use as filter (e.g in a search data) and must used in
conjunction with
GroupListView.check(Collection) to check the selected groups in the corresponding
search. |
static final org.apache.commons.collections4.BidiMap<java.lang.Class<? extends BasicGroup>,java.lang.Class<? extends BasicGroupVO>> VO_MAPPINGS
static java.util.Set<? extends BasicGroup> doFlatten(java.util.Collection<? extends BasicGroup> basicGroups, boolean includeDisabled, boolean includeGroupset)
basicGroups - a Collection extends BasicGroup> which is the input list. This collection is copied to the
result.includeDisabled - a boolean indicating that the disabled groups must be
included. This only
applies for groups which are included via their GroupSet; any disabled group explicitly included in the input is
always included in the output.includeGroupset - a boolean indicating if a GroupSet itself must be included. Members Groups belonging to
the GroupSet are always included; the GroupSet itself is only included if this parameter is true.static java.util.Set<Group> doFlattenGroups(java.util.Collection<? extends BasicGroup> basicGroups, boolean includeDisabledGroups)
org.cyclos.impl.users.GroupListViewFactory all()
BasicGroupListViewFactoryAccessor.accessibles().
This method must be used if we want to include the disabled basic groups in the views returned by the factory.
We directly return a factory because only the accessible groups has support to include disabled.java.util.Set<Group> flatten(java.util.Collection<? extends BasicGroup> basicGroups)
java.util.Set<Group> flattenVOs(java.util.Collection<? extends BasicGroupVO> basicGroups)
flatten(Collection), but takes the VO's as input.java.util.Set<Group> flattenVOs(java.util.Collection<? extends BasicGroupVO> basicGroupVOs, boolean includeDisabledGroupsOfGroupset)
flatten(Collection), but takes the VO's as input, and includes disabled groups depending on the
boolean parameter.includeDisabledGroupsOfGroupset - boolean, if false, the behavior is as flattenVOs(Collection). If true, the
disabled
groups are included if they are part of a groupSet which is selected, no matter if they are explicitly selected
or not.java.util.Set<AdminGroup> getAccessibleGlobalGroups()
Role.GLOBAL_ADMIN role then returns all global groups, it not, returns a set containing its own group.java.util.Set<UserGroup> getAccessibleUserGroups(User user)
GroupVisibility getGroupVisibility(boolean overBrokered)
GroupVisibility for the current user.
As broker we must have the same or bigger visibility than as member, so when brokering, it is used as base-line
the visibility set in member products.java.util.List<InitialGroupVO> getPossiblePublicInitialGroups()
java.util.Set<Group> getPossibleRegistrationGroups(boolean onlyUserGroups, boolean asMember)
onlyUserGroups - if true then only user groups will be returned.asMember - only used in case of the logged user is a broker.java.util.List<InitialGroupVO> getPossibleRegistrationInitialGroups(boolean asMember)
#getPossibleRegistrationGroups(false, boolean) but in case of a
broker registering "as member" or a member the name and description are those set for registration.java.util.Set<BasicGroup> getViewProfileOnGroups()
org.cyclos.impl.users.GroupListViewFactory viewFactory(java.util.Collection<? extends BasicGroup> basicGroups)
org.cyclos.impl.users.GroupListViewFactory viewFactory(org.cyclos.impl.users.GroupList list)
org.cyclos.impl.users.GroupListViewFactoryAccessor visibles()
GroupListView.check(Collection) to check the selected groups in the corresponding
search.GroupVisibility before returning the groups (the other factory methods
(BasicGroupListViewFactoryAccessor.accessibles(), GroupListViewFactoryAccessor.ads(), etc) don't).GroupVisibility.NONE as visibility then a factory returning empty views is returned (never
null) and administrators has GroupVisibility.GROUP.