Skip to main content

Introduction

This package provides a queriable sources (vocabularies) that return PAS users, groups or principals (both users and groups).

They are registered as named vocabularies, so you can do:

class IMyInterface(Interface):
    users = schema.Choice(title=u"Users",
                          vocabulary="plone.principalsource.Users")

    groups = schema.Choice(title=u"Groups",
                           vocabulary="plone.principalsource.Groups")

    principals = schema.Choice(title=u"Principals",
                               vocabulary="plone.principalsource.Principals")

The underlying source (see source.py) implements the IQuerySource interface from z3c.formwidget.query. This means that it can be used for a query-select widget, including the one in plone.formwidget.autocomplete.

A note about unicode

The source attempts to make it safe to do a __contains__ check, a getTerm() lookup, and searches using unicode strings. This is somewhat constrained by the underlying plugins. In particular, the standard ZODBGroups plugin is incapable of searching for groups with unicode titles or ids, and returns a list of all groups if passed a unicode string. As such, the source forces all unicode strings used to search for groups to UTF-8 (searching for users is unaffected).

Also, remember that tokens should be 7-bit ASCII strings. getTermByToken() is forgiving in that it silently encodes a unicode string to utf-8, but really you should only pass unicode to this method.

Changelog

1.0 - 2013-06-04

  • Fix compatibility with Plone 4.3. [davisagli]

1.0b1 - 2009-04-17

  • Initial release

Release files for plone.principalsource 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plone.principalsource 1.0
File Size Uploaded
plone.principalsource-1.0.zip 19.1 kB Details

Release files / plone.principalsource-1.0.zip

Download URL plone.principalsource-1.0.zip
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3dbf9301c695a37e31b73e940d2bea67d9b0e5177a28ac692384481d54f41c50
BLAKE2b-256 checksum
How to use checksums
b9b886d79f3271b81b4dc47a1b8adcccf6a64b75d601784f2f7e9a60f9d4dac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release 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