Class DefaultBackofficeRoleService

    • Constructor Detail

      • DefaultBackofficeRoleService

        public DefaultBackofficeRoleService()
    • Method Detail

      • shouldTreatRolesAsGroups

        public boolean shouldTreatRolesAsGroups()
        Description copied from interface: BackofficeRoleService
        Tells whether backoffice roles should be treated like normal user groups (legacy mode).
        Specified by:
        shouldTreatRolesAsGroups in interface BackofficeRoleService
        Returns:
        true if legacy mode should be used and roles should be treated equal to groups
      • setActiveRole

        public void setActiveRole​(java.lang.String roleId)
        Description copied from interface: BackofficeRoleService
        Sets the active backoffice role in the session. Passing a null or an empty value will remove the attribute from the session.
        Specified by:
        setActiveRole in interface BackofficeRoleService
        Parameters:
        roleId - {@link BackofficeRole@UID} of new active role
      • isActiveRole

        public boolean isActiveRole​(java.lang.String roleId)
        Description copied from interface: BackofficeRoleService
        Tells whether the role with a given id is the current active role.
        Specified by:
        isActiveRole in interface BackofficeRoleService
        Parameters:
        roleId - the role id to check
        Returns:
        true if the id belongs to the current active role, false otherwise
      • getActiveRolePrincipalsHierarchy

        public java.util.Collection<PrincipalGroupModel> getActiveRolePrincipalsHierarchy()
        Description copied from interface: BackofficeRoleService
        Returns user groups hierarchy of the active backoffice role (including the role) or an empty collection if there is no active role.
        Specified by:
        getActiveRolePrincipalsHierarchy in interface BackofficeRoleService
        Returns:
        a collection of all subgroups of active role including this role or empty collection if no active role
      • getNonRolePrincipalsHierarchy

        public java.util.Collection<PrincipalModel> getNonRolePrincipalsHierarchy​(PrincipalModel principal)
        Description copied from interface: BackofficeRoleService
        Returns principal's user groups hierarchy with the exclusion of backoffice roles and their hierarchies. The returned collection is never empty, as it contains at least the principal itself.
        Specified by:
        getNonRolePrincipalsHierarchy in interface BackofficeRoleService
        Parameters:
        principal - principal from which the hierarchy is taken
        Returns:
        a collection of active all subgroups that principal belongs to without those that are backoffice roles or comes from them and this principal
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • getUserService

        protected UserService getUserService()
      • setUserService

        public void setUserService​(UserService userService)