Interface GroupsHandler

    • Method Detail

      • doFlatten

        static Set<? extends BasicGroup> doFlatten​(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). Of each encountered groupSet, all the belonging groups are added.
        Parameters:
        basicGroups - a Collection 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.
      • all

        GroupListViewFactory all()
        Only for administrators or system it will include disabled groups, for members it returns the same as 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.
      • flatten

        Set<Group> flatten​(Collection<? extends BasicGroup> basicGroups)
        Expands the given groups / group sets into a set of groups. Of each encountered groupSet, all the belonging groups are added. The groupset itself is left out.
        Disabled groups are included if they are explicitly included in the input collection. If the disabled group belongs to a groupset, and this groupset is included in the input collection (without the disabled group itself being explicitly included), then the disabled group is NOT included in the result. So if you want to include any disabled group, be sure to add it explicitly in the input parameter.
      • flattenVOs

        Set<Group> flattenVOs​(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.
        Parameters:
        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.
      • getAccessibleGlobalGroups

        Set<AdminGroup> getAccessibleGlobalGroups()
        Returns the accessible admin global groups the logged user can access. If the logged user is not global then an empty set is returned. Otherwise, if it has the Role.GLOBAL_ADMIN role then returns all global groups, it not, returns a set containing its own group.
      • getAccessibleUserGroups

        Set<UserGroup> getAccessibleUserGroups​(User user)
        Returns the accessible groups with type=USER and enabled=true for the given user
      • getGroupVisibility

        GroupVisibility getGroupVisibility​(boolean overBrokered)
        Returns the 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.
      • getPossiblePublicInitialGroups

        List<InitialGroupVO> getPossiblePublicInitialGroups()
        Returns the groups either a public user may use to register himself, or a broker to register a new member
      • getPossibleRegistrationGroups

        Set<Group> getPossibleRegistrationGroups​(boolean onlyUserGroups,
                                                 boolean asMember)
        Returns the possible groups for registering new users for the logged user:
        • if admin: all visible groups if admin products allow registration (Permission.USERS_REGISTER).
        • if broker: depends on the flag asMember: if true then all groups for registration according to the member products, otherwise all groups for registration according to the broker products. In both cases the groups are filtered by the accessible groups.
        • if member / operator: then all groups for registration according to the member products filtered by the accessible groups.
        Parameters:
        onlyUserGroups - if true then only user groups will be returned.
        asMember - only used in case of the logged user is a broker.
      • getViewProfileOnGroups

        Set<BasicGroup> getViewProfileOnGroups()
        Returns the groups the logged user can view profile of users
      • toInitialGroupVO

        InitialGroupVO toInitialGroupVO​(Group group)
        Converts the given group to a InitialGroupVO taking into account the registration settings (name/description) defined for the group.
      • viewFactory

        GroupListViewFactory viewFactory​(GroupList list)
        Returns a view factory for working with brokeredMembers = false and without applying group visibility.