kaliop-uk / ezmigrationbundle

This bundle makes it easy to handle eZPlatform / eZPublish5 content upgrades/migrations
GNU General Public License v2.0
53 stars 81 forks source link

[eZ Platform 3.0] Refactored user authentication to rely on PermissionResolver #226

Closed alongosz closed 5 years ago

alongosz commented 5 years ago

We've finally dropped Repository authentication-related methods that were deprecated since ezpublish-kernel v6.6 (ezsystems/ezpublish-kernel#2764).

This PR refactors the Bundle services which rely on the following Repository methods:

I've chosen to keep trait-based architecture for this, but named the new trait AuthenticatedUserSetterTrait because how it's done is rather an implementation detail. The trait relies on PermissionResolver.

I've also slightly changed the way the login is determined from context, to use more SOLID-oriented approach, avoiding union types and complex "spaghetti" logic, delegating it to separate methods.

I'm dropping here also RepositoryUserSetterTrait because it makes no sense to keep code that will no longer work with ezpublish-kernel 8.0.

Moreover after refactoring I saw that both getAdminUserIdentifier and getAdminUserIdentifierFromContext are no longer used, so I decided to drop them as well. However there's no harm in keeping them if really needed by BC.

damianz5 commented 5 years ago

Hi @gggeek could you please review and merge it? thanks

gggeek commented 5 years ago

Hello. I am bit busy atm. If you are in a hurry I can merge this as is, and review later...

damianz5 commented 5 years ago

Ok, please merge. I've tested it locally on ezp-demo instance.

gggeek commented 5 years ago

Ok. Not promising not to changw anything later...