Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.deletepermission

How to install collective.deletepermission

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.deletepermission
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
1.1.1 Available View build log
 
Author
License
GPL2
Depended by
Lastest release
version 1.1.1 on Jan 9th, 2014

collective.deletepermission

The default Plone permission for deleting content does not allow to delete content from a folder without being able to delete the folder itself.

The collective.deletepermission package introduces an additional permission Delete portal content. By seperating the permission Delete portal content (I can delete this content object) from the permission Delete objects (I can delete something IN this folder), we now can allow a Contributor to delete content he created (Owner role) without letting him delete folders and objects belonging to other users - even in a nested environment.

Implementation details

This package monkey patches:

  • manage_delObjects of AT BaseFolder
  • manage_cutObjects__roles__ of AT BaseFolderMixin
  • cb_userHasCopyOrMovePermissionchecks of OFS CopySupport

and overrides the following templates and scripts (skins):

  • folder_rename_form.cpt
  • object_rename.py

to implement a new Delete portal content permission.

The Delete portal content permission is now required on the object you want to delete. On parent objects the Delete objects permission is still required. This gives us some more flexibility and makes it possible for a contributor to delete his own content but nothing else. On the graph below you can see the situation with the default permission settings and if it is deletable by Contributor1.

- Rootfolder of Admin (not deletable)

System Message: ERROR/3 (<string>, line 47)

Inconsistent literal block quoting.

'- Document of Contributor1 (deletable) '- Subfolder of Admin (not deletable) '- Document of Contributor1 (deletable) '- Document of Contrubutor2 (not deletable)

In default Plone this would look like this:

- Rootfolder of Admin (not deletable)

System Message: ERROR/3 (<string>, line 55)

Inconsistent literal block quoting.

'- Document of Contributor1 (deletable) '- Subfolder of Admin (deletable) '- Document of Contributor1 (deletable) '- Document of Contrubutor2 (deletable)

This is caused by the fact that in default Plone we require the same permission on the parent and the object. If we have two levels where we should be able to delete some files, we always end up with the user being able to delete the container of the second level.

Usage
  • Add collective.deletepermission to your buildout configuration:
[instance]

System Message: ERROR/3 (<string>, line 74)

Inconsistent literal block quoting.

eggs += collective.deletepermission

  • Install the generic setup import profile.
Compatibility

Runs with Plone 4.1, 4.2 and 4.3.

Changelog

1.1.1 (2013-06-04)
  • Only show "Delete" action with "Delete objects" on the container.

System Message: WARNING/2 (<string>, line 110)

Bullet list ends without a blank line; unexpected unindent.

[jone]

1.1 (2013-05-24)
  • Do not require 'Delete portal content' permission when renaming an object.

System Message: WARNING/2 (<string>, line 117)

Bullet list ends without a blank line; unexpected unindent.

[buchi]

1.0 (2013-01-24)
  • Init release

System Message: WARNING/2 (<string>, line 124)

Bullet list ends without a blank line; unexpected unindent.

[mathias.leimgruber]

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.