collective.preventactions
This package allows administrators to mark objects which can’t be deleted or renamed/moved.
Versions
Version 0.4 is for Plone 6.1 / 6.2 and Python 3.10+
Version 0.3 is for Plone 5.2 and Python 3
Versions < 0.3 are compatible with Archetypes (branch 0.2.x)
How it works
This package use marker interfaces and subscribe to IObjectWillBeRemovedEvent and IObjectWillBeMovedEvent events. If a marker interface is find on modified object, a exception will be raised.
You can also set some contents not deletable (for example) like this in your setuphandler :
from collective.preventactions.interfaces import IPreventDelete
from plone import api
from zope.interface import alsoProvides
def post_install(context):
obj = api.content.get('/Plone/content-not-deleteable')
alsoProvides(obj, IPreventDelete)
obj.reindexObject(idxs=["object_provides"])
Reindexing object_provides lets the uninstall profile find and unmark the object.
Installation
To install collective.preventactions you simply add collective.preventactions to the list of eggs in your buildout, run buildout and restart Plone.
Then, install collective.preventactions using the Add-ons control panel.
Development
You only need uv. The Makefile follows the one generated by cookieplone for a backend add-on
make install # .venv (Python 3.12, Plone 6.2.3) and instance configuration make create-site # create a "Plone" site with collective.preventactions installed make start # http://localhost:8080/Plone (admin / admin) make console # debug console on the instance make remove-data # remove all content (and the .venv)
make clean && PLONE_VERSION=6.1-latest make install builds against another Plone release, and DELETE_EXISTING=1 make create-site recreates the site.
Tests and code quality are managed by plone.meta and tox
make test # tests on Python 3.12 with Plone 6.2.3 make lint # pre-commit hooks (black, isort, flake8, zpretty, codespell...) make format # reformat code make test-all # lint, every supported Python / Plone version, dependency checks
Any tox environment can be run directly, e.g. uvx --with tox-uv tox -e py313-plone61. Do not edit the files generated by plone.meta: change .meta.toml and run uvx --from plone.meta config-package --branch current . instead.
License
The project is licensed under the GPLv2.
Changelog
0.4.0 (2026-11-12)
Fix: the “Prevent actions” form now reindexes object_provides, so the uninstall profile also unmarks objects protected through the form. [remdub]
Fix: the uninstall profile now removes the “Prevent actions” object action. [remdub]
Modernize package (Plone 6.2.3, PEP420, plone.meta, tests, french locales) [remdub]
Add behavior to choose which content types to prevent. [remdub]
0.3.0 (2019-11-26)
Remove Archetypes dependency. [bsuttor]
0.2.1 (2018-07-10)
Typo. [bsuttor]
0.2 (2018-07-09)
Fix check render of PreventActionForm. [bsuttor]
0.1 (2016-09-20)
Package created using mr.bob [bsuttor]
Metadata
Release files for collective.preventactions 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| collective_preventactions-0.4.0.tar.gz | 82.6 kB | Without provenance | Details for collective_preventactions-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| collective_preventactions-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for collective_preventactions-0.4.0-py3-none-any.whl |
Total release size: 108.3 kB
Release files / collective_preventactions-0.4.0.tar.gz
| Download URL | collective_preventactions-0.4.0.tar.gz |
|---|---|
| Size | 82.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0c8f3cbcc1b2ff3333995e1af2d5aac55dd819cd4321d997fa8b6d8cd74ed58
|
|
BLAKE2b-256 checksum How to use checksums |
37183186c0e750e5f50bf753e57284e777dc523fe330f76fe9a5d8e3a81b8c77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / collective_preventactions-0.4.0-py3-none-any.whl
| Download URL | collective_preventactions-0.4.0-py3-none-any.whl |
|---|---|
| Size | 25.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
371746e1c599185042950e347d3aa28f4a46a3f8a9c54871b68d4261d3e32ee0
|
|
BLAKE2b-256 checksum How to use checksums |
e001f6d9730ad43f804d6466d1df03f9029c1aedf2574c6d1765c0be0c3a1d6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for collective.preventactions 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.