Repository navigation
Conversation
Since 1.0.0a12, ensure_profile asked the FTI for IUserProfile and refused any type that did not provide it. A site that keeps accounts and plain pages in one type, and marks only the accounts from an add subscriber, got no profile on a first federated or source_users login. ensure_profile now asks the type for IUserContent, as doAddUser does, and asks the created object for IUserProfile. An object left unmarked is deleted again: left in place, the next login's create collides with its id and raises BadRequest inside the login. A user type the principals container does not allow is declined before creating, which keeps the case where the site creates the object itself from failing with InvalidParameterError. Closes #129
ensure_profile resolved the Profile container with create=True and only then asked whether it allows the user type, so a login that went on to decline still created the container. The question is now asked first, of the existing container's FTI or, when there is none yet, of the type get_container would create it as. Also drive a federated login end to end on a type marked on add, so the claims sync onto a type other than UserProfile is covered: the account is created, its name and address are synced, and a later login updates the name. Refs #129
identity_profile implemented IGroupIntrospection but not IUserIntrospection, so api.user.get_users(), listMembers() and acl_users.getUserIds()/getUserNames()/getUsers() left out every user with a Profile and no source_users row, while searches found them. The plugin now answers those calls from the enumeration-active Profile brains. PlonePAS concatenates what every introspector returns without removing duplicates, and a user added through api.user.create has both a Profile and a source_users credential, so the plugin lists only the userids no other introspector lists. Install activates the interface, and upgrade step 1010 activates it on existing sites without re-running the install handler, which would also move the plugin to the top of IPropertiesPlugin. Closes #131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes that kitconcept-core hit on the upgrade to 1.0.0a12, where
Personis the site's user type.#129: a user type whose objects are marked one by one
Since 1.0.0a12 (#127),
ensure_profilerefused any user type whose FTI does not provideIUserProfile. That broke sites that keep accounts and plain pages in one type and mark only the accounts from an add subscriber, as kitconcept-core does withcollective.person'sPerson. On those sites a first federated orsource_userslogin created no profile and synced no claims.ensure_profilenow:IUserContent, the same checkdoAddUsermakes.InvalidParameterErrorfor a site that creates its user objects itself.IUserProfile. If the object is not marked, it is deleted again and the call answersNone. Left in place, the object would make the next login's create fail withBadRequest(id already in use) during the login.A type that provides
IUserProfileat the type level (UserProfile, or a type withprincipal_user) behaves as before.The identity catalog's subscribers are bound to the marker, and for a given event they are looked up before any handler runs. So a subscriber that marks an object on
IObjectAddedEventhas to file it itself withprofile_moved, as kitconcept-core already does. The how-to now shows that subscriber and explains why.#131: listing users who only have a profile
identity_profileimplementedIGroupIntrospectionbut notIUserIntrospection. Soapi.user.get_users(),listMembers()andacl_users.getUserIds()/getUserNames()/getUsers()left out every user with a profile and nosource_usersrow, while searches found them.api.user.createhas both a profile and asource_userscredential, so the plugin lists only the userids no other introspector lists. Each user appears once, whatever the plugin order.IPropertiesPlugin.Tests
tests/core/principal_types/test_own_user_type.pycovers:_handle→sync_claims) on a type marked on add.tests/core/pas/test_external_user_record.pycovers the container guard: a declined login creates no container.tests/core/pas/test_user_introspection.pyandtests/setuphandlers/upgrades/test_v1010.pycover identity_profile does not implement IUserIntrospection, so api.user.get_users() misses its users #131.2 == 1) and the upgrade.check-imports,docs-buildandvalepass.kitconcept-core ran its site against the #129 part of this branch, and it fixes #129 there.
Docs
reference/user-content.md: what a login does for each kind of user type, and which PAS interface answers a search and which a listing.how-to-guides/extend/use-your-own-user-type.md: "When only some objects of your type are users".Closes #129
Closes #131