Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

https://github.com/collective/dexterity.localroles/actions/workflows/main.yml/badge.svg?branch=master https://coveralls.io/repos/github/collective/dexterity.localroles/badge.svg PyPI badge

Introduction

Allow to define local roles settings by dexterity type.

A new configuration page is added as a new tab on a dexterity type configuration.

A configuration line has the following fields:

  • the state

  • the principal

  • the roles

  • an optional configuration as string, but evaluated as a dict: {‘utility name’: [roles]}. The utility implements ILocalRolesRelatedSearchUtility and get related objects.

You can then define for each state which principal will receive some local roles automatically on the content, and other local roles on related content.

By example:

  • on the “pending” state, the “stephen” user will receive the following role: Reviewer.

  • on the “published” state, the “editors” group will receive the following roles: Editor, Reviewer.

The utility “dexterity.localroles.related_parent” get the object parent and can be used to give local roles on the content parent.

  • on the “pending” state, the “stephen” user will receive on the content parent the role: Reviewer.

Those automaticaly given roles cannot be manually removed by the “sharing” tab (read only, as inherited roles).

This package is a base for dexterity.localrolesfield that adds a field to define the principal.

Versions

  • Version 2.x is compliant Plone 4, Plone 6

  • version 1.x is for Plone 4 only

Installation

  • Add dexterity.localroles to your eggs.

  • Re-run buildout.

  • Done.

Credits

Have an idea? Found a bug? Let us know by opening a ticket.

Contributors

  • IMIO, Original Author

Changelog

2.0.0b2 (2026-08-14)

  • Replaced json.loads with ast.literal_eval (DMS-1218). [chris-adam]

2.0.0b1 (2026-06-19)

  • Added utils.register_affected_portal_type`and `utils.get_affected_portal_types to get and store portal types concerned by local roles changes. [sgeulette]

  • Do not update security if request contains DEFER_SECURITY_UPDATE value (skips reindexObjectSecurity). [sgeulette]

  • Corrected tests setup [sgeulette]

  • Corrected json format in related field [sgeulette]

2.0.0b0 (2026-01-15)

  • Added Plone 6.1 version in buildout. [chris-adam, sgeulette]

  • Added dexterity.localroles.related_parent_with_portal utility to include Plone Site in related parent search. [sgeulette]

  • Added Plone 6 uninstall profile. [chris-adam]

  • Improved security of ‘related’ field by restricting its value to JSON. [chris-adam]

2.0.0a (2023-11-28)

  • Plone 4.3 and 6.0 compliant [sgeulette]

1.6 (2022-07-01)

  • Added ‘rel’ (related) handling in utils.update_roles_in_fti [sgeulette]

  • Added ‘rem’ action in utils.update_roles_in_fti [sgeulette]

  • Added ‘portal_type’ parameter in utils.fti_configuration [sgeulette]

1.5 (2021-08-27)

  • Added update_roles_in_fti method to update local roles in a config. [sgeulette]

  • Added update_security_index method to update security index [sgeulette]

1.4 (2019-06-23)

  • Safe dict key access [sgeulette]

  • Added css id in configuration form. [sgeulette]

1.3 (2018-11-06)

  • Use safely state title in unicode. [sgeulette]

1.2 (2017-05-30)

  • Refactored utils method [sgeulette]

  • Added method to delete related uid annotation. [sgeulette]

1.1 (2016-04-18)

  • Useless subscriber removed. [sgeulette]

1.0 (2015-11-24)

  • Use only local roles in vocabulary. [sgeulette]

  • Store all configuration in one fti attribute ‘localroles’. Useful for dexterity.localrolesfield to avoid a field name is an existing attribute [sgeulette]

  • Add a related field to store a text configuration that will be used to set related objects local roles. [sgeulette]

  • Add related search utility [sgeulette]

  • Change related local roles on transition, on addition, on removal, on moving, on configuration changes [sgeulette]

  • Add an adapter for related local roles [sgeulette]

  • Simplify code [sgeulette]

0.2 (2015-06-02)

  • Avoid exception on site deletion [sgeulette]

0.1 (2014-10-24)

  • Various improvements [mpeeters, sgeulette]

  • Added tests [sgeulette]

  • Some improvements [sgeulette]

  • Add validation on configuration view [mpeeters]

  • Add localroles configuration view [mpeeters]

  • Add an adapter for borg.localrole [mpeeters]

Download files

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

Source Distribution

dexterity_localroles-2.0.0b2.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dexterity_localroles-2.0.0b2-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file dexterity_localroles-2.0.0b2.tar.gz.

File metadata

  • Download URL: dexterity_localroles-2.0.0b2.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for dexterity_localroles-2.0.0b2.tar.gz
Algorithm Hash digest
SHA256 edf032140bf7fd127fd8e130978b7d612ca5998ad6aab25d76594bd5d25676a6
MD5 459b637df30dc3f3afce5d9507cd35c0
BLAKE2b-256 49833ea2ed16ca2093d2762d447cc25673af78ec56cebef73f76ef36a699238f

See more details on using hashes here.

File details

Details for the file dexterity_localroles-2.0.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for dexterity_localroles-2.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 25b223aab2f6bcc859c62c28486687f14ad70be861ae7a263cd0b4b70347c338
MD5 4ec7580ab490c690a1cf914fe028874b
BLAKE2b-256 a4505baafd83fd09b3cb00bd872cbd9327e0a2fdefa4c4164d44d39c345f7aaa

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0b2 This release

2 files

1.6

1 file

1.5

1 file

1.4

1 file

1.3

1 file

1.2

1 file

1.1

1 file

1.0

1 file

0.2

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page