Interface PermissionHandler<DTO extends ProductDTO,​AD extends ActiveProductsData>


  • public interface PermissionHandler<DTO extends ProductDTO,​AD extends ActiveProductsData>
    Handles conversion of permissions between ProductDTOs and Products
    • Method Detail

      • getDTOProperty

        Property<?,​? super DTO> getDTOProperty()
        Returns:
        the property of the DTO used to grant/revoke the managed permissions
        See Also:
        getPermissions()
      • getKey

        MessageKey getKey()
        Returns the message key associated to the DTO property
      • getPermissions

        List<Permission> getPermissions()
        Returns:
        the list of permissions managed by this handler
      • readPermissions

        default void readPermissions​(Collection<Permission> permissions,
                                     AD dto)
        Reads the permissions collection, setting the corresponding properties on the given Product data
      • readPermissions

        default void readPermissions​(Collection<Permission> permissions,
                                     DTO dto)
        Reads the permissions collection, setting the corresponding properties on the given DTO
      • writePermissions

        default void writePermissions​(DTO dto,
                                      Collection<Permission> permissions)
        Adds / removes corresponding permissions to the collection, according to the DTO properties