Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not persist changes to account #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pKallert
Copy link
Contributor

@pKallert pKallert commented Oct 5, 2023

closes #5

Apparently we do not want changes to our account be persisted, but with the user saving it is persisted.

I hope clearing the persistence manager will solve the problem while still remembering the stuff in the cookie.

For testing I have tested on local with the following steps:

  • Login and Logout
  • Changing my own user account: Adding Editor permissions
  • Changing my own user account: Removing Admin permissions, Adding Editor and Neos User Manager permissions
  • Changing other user accounts: Changing Name & Permissions
  • Changing / saving content in live workspace

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure without taking a deeper look, TBH. Is this method never called when there are actual changes that should be persisted?

@pKallert
Copy link
Contributor Author

pKallert commented Oct 5, 2023

The method is called two times in addBackendUserAndAccountIfNotExistent:

  • set the account if the user already exists
  • set the account if the user was newly created

It is called at the end of the method right after a persist or right before a return.

Also, we have the call to $this->persistenceManager->persistAll(); four lines above: https://github.com/flownative/openidconnect-neos/blob/main/Classes/AccountManager.php#L170C9-L170C49
So it would really only delete the two lines from persistance since we can ensure all earlier changes are persisted.

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine…

Not the ideal solution, as it allows to do things that are not persisted (without any explanation to the user). Blocking this (if not possible/allowed) or making it persist changes as needed (without the too-long-data) would be great.

But that's probably something for another issue…

@kdambekalns kdambekalns changed the title Fix: Do not persist changes Do not persist changes to account Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Cannot change own user account
2 participants