Metadata-Version: 2.4
Name: collective.limitfilesizepanel
Version: 3.1.0
Summary: Configure files and images size limit through Plone control panel
Home-page: https://github.com/RedTurtle/collective.limitfilesizepanel
Author: RedTurtle Technology
Author-email: sviluppoplone@redturtle.it
License-Expression: GPL-2.0-only
Project-URL: PyPI, https://pypi.org/project/collective.limitfilesizepanel/
Project-URL: Source, https://github.com/RedTurtle/collective.limitfilesizepanel
Project-URL: Tracker, https://github.com/RedTurtle/collective.limitfilesizepanel/issues
Keywords: plone plonegov limit filesize validation
Classifier: Environment :: Web Environment
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: Addon
Classifier: Framework :: Plone :: 6.0
Classifier: Framework :: Plone :: 6.1
Classifier: Framework :: Plone :: 6.2
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Requires-Dist: setuptools
Requires-Dist: plone.api
Requires-Dist: plone.app.registry
Requires-Dist: plone.restapi
Requires-Dist: collective.monkeypatcher>=1.0
Requires-Dist: z3c.unconfigure
Requires-Dist: collective.z3cform.jsonwidget>=2.0.2
Provides-Extra: test
Requires-Dist: plone.app.testing; extra == "test"
Requires-Dist: plone.testing>=5.0.0; extra == "test"
Requires-Dist: plone.app.contenttypes; extra == "test"
Requires-Dist: plone.app.robotframework[debug]; extra == "test"
Requires-Dist: plone.restapi[test]; extra == "test"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: keywords
Dynamic: license-expression
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

This is an helper package that setup a RedTurtle's Plone site ready to work with Volto.


|python| |version| |ci| |coverage| |downloads| |license|

.. |python| image:: https://img.shields.io/pypi/pyversions/collective.limitfilesizepanel.svg
  :target: https://pypi.python.org/pypi/collective.limitfilesizepanel/

.. |version| image:: http://img.shields.io/pypi/v/collective.limitfilesizepanel.svg
  :target: https://pypi.python.org/pypi/collective.limitfilesizepanel

.. |ci| image:: https://github.com/RedTurtle/collective.limitfilesizepanel/actions/workflows/test-matrix.yml/badge.svg
  :target: https://github.com/RedTurtle/collective.limitfilesizepanel/actions

.. |downloads| image:: https://img.shields.io/pypi/dm/collective.limitfilesizepanel.svg
   :target: https://pypi.org/project/collective.limitfilesizepanel/

.. |license| image:: https://img.shields.io/pypi/l/collective.limitfilesizepanel.svg
    :target: https://pypi.org/project/collective.limitfilesizepanel/
    :alt: License

.. |coverage| image:: https://coveralls.io/repos/github/redturtle/collective.limitfilesizepanel/badge.svg?branch=master
    :target: https://coveralls.io/github/redturtle/collective.limitfilesizepanel?branch=main
    :alt: Coverage
    

Introduction
============

This product allows you to set a max siza validation for file and image fields in content-types.

How to use it
=============

Just add the product to the buildout and install it in the site you want to use.

A new "*Limit file size settings*" option will be added in the control panel, where you can change the
*File* and *Image* attachments.

No users will be able to upload files that exceed the limit. Also in TinyMCE text editor.

.. image:: https://raw.githubusercontent.com/RedTurtle/collective.limitfilesizepanel/93abb025ecae1070e28ead13874fc07dc25de52e/docs/collective.limitfilesizepanel-1.3-01.png
   :alt: Settings

Validator bypass
================

If some users need to bypass the validation and upload some larger files, there is a new permission
"*collective.limitfilesizepanel: Bypass limit size*" that allows to do this.

You only need to set this permission to some roles, and they'll have no upload limits.

Compatibility
=============

This products runs on Python 3.11+ and has been tested on:

* Plone 6.0
* Plone 6.1
* Plone 6.2

For Plone 5.2, please refer to 3.0.x releases.
For older versions, please refer to 2.x branch/tags

Credits
=======

Developed with the support of:

* `Regione Emilia Romagna`__
* `Province of Vicenza`__

  .. image:: http://www.provincia.vicenza.it/logo_provincia_vicenza.png
     :alt: Province of Vicenza - logo

All of them supports the `PloneGov initiative`__.

__ http://www.regione.emilia-romagna.it/
__ http://www.provincia.vicenza.it/
__ http://www.plonegov.it/

Authors
=======

This product was developed by RedTurtle Technology team.

.. image:: http://www.redturtle.it/redturtle_banner.png
   :alt: RedTurtle Technology Site
   :target: http://www.redturtle.it/

Changelog
=========

3.1.0 (2026-10-22)
------------------

- Added @limit-sizes service and limit-sizes expander to expose file and
  image size limits (in MB), the new_data_only setting and the bypass
  permission of the current user.
  Run upgrade step to 1400 to set the new permission's roles.
  [daniele]
- Removed "Settings for other content types and fields" (types_settings) setting
  and collective.z3cform.jsonwidget dependency: limits are now only the global
  ones for files and images.
  Upgrade step to 1400 removes the old registry record and uninstalls
  collective.z3cform.jsonwidget (if installed and not required by other products).
  collective.z3cform.jsonwidget is still in install_requires only to allow its
  uninstall: it will be removed in the next release.
  [cekk]
- Use native (PEP 420) namespace for ``collective``.
  [cekk]
- Expose the control panel on plone.restapi (@controlpanels/limitfilesize-settings),
  so it can be managed from Volto.
  [cekk]
- "Validate only new data" is no more required, so it can be unchecked.
  [cekk]
- Support Plone 6.0, 6.1 and 6.2 on Python 3.11+ and drop Plone 5.2 support.
  Configure the package with plone.meta (tox and GitHub Actions) and remove
  the old buildout-based test setup.
  [cekk]


3.0.3 (2023-09-27)
------------------

- Fix check in validators if product is not installed.
  [cekk]


3.0.2 (2023-05-02)
------------------

- Raise custom ValidationError to have a 400 on restapi calls.
  [cekk]


3.0.1 (2023-05-02)
------------------

- Raise ValueError instead Invalid for restapi calls.
  [cekk]


3.0.0 (2023-04-27)
------------------

- Python3 support.
  [cekk]
- Drop usage of persistent fields in registry. Now we use collective.z3cform.jsonwidget.
  [cekk]
- Change validator to work also with restapi calls.
  [cekk]


2.1.2 (2018-07-17)
------------------

- Fix release
  [cekk]

2.1.1 (2018-07-17)
------------------

- Fix permission for upload view
  [eikichi18]


2.1.0 (2018-05-09)
------------------

- Fix validators for Dexterity fields. Now works well with Files and images
  [cekk]
- Add support for Tinymce validation also for Plone 5
  [cekk]


2.0.3 (2018-01-30)
------------------

- Don't break validation for view with no specific context.
  [bsuttor]


2.0.2 (2017-09-15)
------------------
- Fix brown bag release
  [cekk]

2.0.1 (2017-09-14)
------------------

- Don't break validation if the product isn't installed.
  If not installed, shouldn't do nothing.
  [cekk]

- Fix patched__call__ if the product isn't installed.
  [arsenico13]

2.0.0 (2017-05-04)
------------------

- Version 1.3 don't uninstall cleanly
  [keul]
- Now validates also files and images created in TinyMCE
  [cekk]
- Dexterity support
  [cekk]

1.3 (2015-07-06)
----------------

- Added type+field configuration
  [keul]
- Pyflakes cleanup
  [keul]

1.2 (2013-08-19)
----------------

- Add German translations.
  [jone]
- Ensure consistency of megabyte symbols to be ``MB``.
  [davidjb]


1.1.2 (2013-03-26)
------------------

- run rolemap configurations when upgrading from older versions
  [keul]

1.1.1 (2013-03-26)
------------------

- fixed pypi classifiers [keul]

1.1 (2013-03-26)
----------------

- Added a proper uninstall step [keul]
- Now based on `collective.monkeypatcher`__ [keul]
- i18n refactoring [keul]
- Do not try to automatically validate file size for already existings attachments.

  This provent to get validation error when editing file after size limit
  has been changed [keul]

- Added new permission "collective.limitfilesizepanel: Manage limit file size settings".
  Users with this permission can bypass size validation [cekk]

  __ http://pypi.python.org/pypi/collective.monkeypatcher

1.0 (Unreleased)
----------------

- Initial release
