Giter VIP home page Giter VIP logo

collective.deletepermission's Introduction

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 and Dexterity Container
  • manage_cutObjects__roles__ of AT BaseFolderMixin and Dexterity Container
  • manage_pasteObjects__roles__ of AT BaseFolderMixin and Dexterity Container
  • 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)
  '- 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)
  '- 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]
eggs +=
    collective.deletepermission
  • Install the generic setup import profile.

Links

Copyright

This package is copyright by 4teamwork.

collective.deletepermission is licensed under GNU General Public License, version 2.

collective.deletepermission's People

Contributors

jone avatar mbaechtold avatar erral avatar maethu avatar lukasgraf avatar libargutxi avatar sauzher avatar buchi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.