Class AdminWorkgroupService


  • public final class AdminWorkgroupService
    extends Object
    AdminWorkgroupService
    • 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> Collection<E> getAuthorizedCollection​(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> Collection<E> getAuthorizedCollection​(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,
                                                      Locale locale)
        Gets all workgroups of the user
        Parameters:
        user - The current user
        locale - The Locale
        Returns:
        A list of workgroup
      • normalizeWorkgroupKey

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