Class AdminWorkgroupService


  • public final class AdminWorkgroupService
    extends java.lang.Object
    AdminWorkgroupService
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ALL_GROUPS  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <E extends fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource>
      java.util.Collection<E>
      getAuthorizedCollection​(java.util.Collection<E> collection, fr.paris.lutece.api.user.User user)
      Filter a collection of resources for a given user
      static <E extends fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource>
      java.util.Collection<E>
      getAuthorizedCollection​(java.util.Collection<E> collection, AdminUser user)
      Deprecated.
      use getAuthorizedCollection( Collection, User )
      static ReferenceList getUserWorkgroups​(AdminUser user, java.util.Locale locale)
      Gets all workgroups of the user
      static boolean isAuthorized​(fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource resource, fr.paris.lutece.api.user.User user)
      Check if a resource should be visible to the user according its workgroup
      static boolean isAuthorized​(fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource resource, AdminUser user)
      Deprecated.
      use isAuthorized( AdminWorkgroupResource, User )
      static java.lang.String normalizeWorkgroupKey​(java.lang.String strAdminWorkgroup)
      Normalized an empty or null workgroup key
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isAuthorized

        public static boolean isAuthorized​(fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource resource,
                                           fr.paris.lutece.api.user.User user)
        Check if a resource should be visible to the user according its workgroup
        Parameters:
        resource - The resource to check
        user - The current user
        Returns:
        true if authorized, otherwise false
      • isAuthorized

        @Deprecated
        public static boolean isAuthorized​(fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource resource,
                                           AdminUser user)
        Deprecated.
        use isAuthorized( AdminWorkgroupResource, User )
        Check if a resource should be visible to the user according its workgroup
        Parameters:
        resource - The resource to check
        user - The current user
        Returns:
        true if authorized, otherwise false
      • getAuthorizedCollection

        public static <E extends fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource> java.util.Collection<E> getAuthorizedCollection​(java.util.Collection<E> collection,
                                                                                                                                                  fr.paris.lutece.api.user.User user)
        Filter a collection of resources for a given user
        Type Parameters:
        E - The workgroup resource
        Parameters:
        collection - The collection to filter
        user - The user
        Returns:
        A filtered collection of resources
      • getAuthorizedCollection

        @Deprecated
        public static <E extends fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource> java.util.Collection<E> getAuthorizedCollection​(java.util.Collection<E> collection,
                                                                                                                                                  AdminUser user)
        Deprecated.
        use getAuthorizedCollection( Collection, User )
        Filter a collection of resources for a given user
        Type Parameters:
        E - The workgroup resource
        Parameters:
        collection - The collection to filter
        user - The user
        Returns:
        A filtered collection of resources
      • getUserWorkgroups

        public static ReferenceList getUserWorkgroups​(AdminUser user,
                                                      java.util.Locale locale)
        Gets all workgroups of the user
        Parameters:
        user - The current user
        locale - The Locale
        Returns:
        A list of workgroup
      • normalizeWorkgroupKey

        public static java.lang.String normalizeWorkgroupKey​(java.lang.String strAdminWorkgroup)
        Normalized an empty or null workgroup key
        Parameters:
        strAdminWorkgroup - The workgroup key to normalize
        Returns:
        The workgroup key normalized