Skip to content

This package add an action on all plone objects, this action allows or not that an object is deletable / moveable

Notifications You must be signed in to change notification settings

collective/collective.preventactions

Repository files navigation

https://travis-ci.org/collective/collective.preventactions.svg?branch=master https://coveralls.io/repos/collective/collective.preventactions/badge.svg?branch=master

collective.preventactions

This package allows administrateur to marker object which can't be deleted or renamed/moved.

The map on a collection.

Versions

  • Versions > 0.3 are 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 deleteable (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)

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.

License

The project is licensed under the GPLv2.

About

This package add an action on all plone objects, this action allows or not that an object is deletable / moveable

Resources

Stars

Watchers

Forks

Packages

No packages published