Skip to main content

Provide delete, rename and password protection for Plone items.

Project description

Introduction

This package provides 3 behaviors to secure your Dexterity content types in 3 ways:

  • “Password Protected”: Will allow you to set a password to specific object so any user, except manager or its owner, needs to provide it to access it or its children (if the protected content type is a folderish)

  • “Delete Protection”: Intended for folderish content types, this behavior will protect the content’s children for being removed.

  • “Rename Protection”: Intended for folderish content types, this behavior will protect the content’s children for being renamed. Note: For this particular behavior, this only protects renaming through the UI, and does not protect the object if it is renamed using manage_renameObjects programatically from its parent.

Installation

Just add ‘collective_folderprotection’ to your eggs list in your buildout and re-run buildout. The dexterity is included by the use of the ‘dexterity’ extra, so make sure to include that, or to pull dexterity separatedly.

Usage

After installing this product, you should be provided with 3 new behaviors to activate from the “Dexterity content types” tool. If you want to enable them from your type XML, just add any of the following:

  • collective_folderprotection.behaviors.interfaces.IPasswordProtected

  • collective_folderprotection.behaviors.interfaces.IDeleteProtected

  • collective_folderprotection.behaviors.interfaces.IRenameProtected

Password protection

There are 3 different ways in which you can assign a password to your “Password protected” enabled content.

Through the add/edit views

When adding or editing a content type which has the behavior enabled, you should see a new field along the schema, with the “Password” label. Enter your password here to assign it. Leave it blank, to remove password protection for this specific object. NOTE: This is not available for Archetypes.

Through the “Assign password” view

You should see a new tab for an object which has the behavior enabled. Going to this view and entering any password will assign it. Leave it blank, to remove password protection for this specific object. This view is independent from the add/edit ones, you can use either one.

Programatically on content creation

If you are creating content programatically, you can assign a password when calling the function, just by adding the optional “password” argumnent.

from plone.dexterity.utils import createContentInContainer
...
...
createContentInContainer(self.portal, "your.app.dexterity.fti.information", title=title, password=pw)

Delete protection

When the behavior is enabled for a given content type, a new checkbox will be shown in both the add and the edit screens, when creating or editing that specific content type. Marking the checkbox will protect this element and its direct children (if this is a folderish type) from being deleted.

Rename protection

When the behavior is enabled for a given content type, a new checkbox will be shown in both the add and the edit screens, when creating or editing that specific content type. Marking the checkbox will protect this element and its direct children (if this is a folderish type) from being renamed. Contributors ============

  • Franco Pellegrini, Original Author

Lock Icons provided by http://www.danilodemarco.com/

Changelog

2.4 (2024-04-17)

  • Add Plone 6 support [frapell]

2.3 (2021-01-11)

  • Bugfix: Infinite loop when context is the actual Plone site [frapell]

2.2 (2021-01-06)

  • Remove the password protection field from the edit and add forms, to avoid issues with browsers password auto-fill causing issues [frapell]

  • Create a new password widget to use the autocomplete attribute in the <input> field, to prevent browser auto filling passwords [frapell]

  • Replace the checkbox to clear password protection with a clear red button [frapell]

  • Include a viewlet that will show up when the given folder or a parent folder is password protected [frapell]

  • Include a richtext field to provide the ability to include a reason on why the folder is password protected [frapell]

2.1 (2019-12-10)

  • Raise exceptions if a protected item is renamed or deleted [frapell]

  • Include uninstall profile and add post_install routines to ignore exceptions [frapell]

2.0.1 (2019-08-06)

  • Fix rst format for pkg description [frapell]

2.0 (2019-08-06)

  • As of this version, this product only supports Plone 5.0+

  • Remove support for Archetypes [enfold-josh]

  • Support Python 3 and Plone 5.2 [enfold-josh,frapell]

  • Catch exception raised when inserting post_traverse hook during a non-publishing traversal. [enfold-josh]

  • Fix tests. [enfold-josh]

  • Change functional test files extensions to .robot [enfold-josh]

1.0-dev (unreleased)

  • Add support for Archetypes [frapell]

  • Make Dexterity an optional dependency [frapell]

  • Include behavior to prevent removing items from a folderish [frapell]

  • Include behavior to prevent renaming items in a folderish (only through UI). [frapell]

  • Include behavior to allow setting a password for viewing a folder [frapell]

  • Package created using templer [frapell]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective_folderprotection-2.4.tar.gz (40.7 kB view details)

Uploaded Source

Built Distribution

collective_folderprotection-2.4-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file collective_folderprotection-2.4.tar.gz.

File metadata

File hashes

Hashes for collective_folderprotection-2.4.tar.gz
Algorithm Hash digest
SHA256 22e6d0cbaf66c4d6d5f716f86a58445dee25eab0dcd2538a3195af05e8f9d8ad
MD5 1099f3420632f84a45632d9e8267e8dc
BLAKE2b-256 1a0d03524d9ef7660973b36b1f1640afcbb402331e2ba8427ed2d3c66d0cbfa1

See more details on using hashes here.

File details

Details for the file collective_folderprotection-2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for collective_folderprotection-2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d47914fb1987a165c98f36a14eadf345550e539fc50015e5f88fc0f26cec72a3
MD5 09b80585aed09413a21fbf41a31b2f35
BLAKE2b-256 d891d9b0cc8f3a07326d4ae2f3202b8c7d0d5ffaa9c1687eb328b9d93ba0905e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page