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

Refactor rendering to generate user accounts instead of using existing accounts #2

Open
Ambient-Impact opened this issue Jul 22, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Ambient-Impact
Copy link
Member

Ambient-Impact commented Jul 22, 2022

Currently, RepresentativeRenderUserInterface::getUserToRenderAs() works by finding a user account with the required combination of roles but this is potentially insecure if this somehow reveals something to a user account that should not have access to that information, such as admin information or data.

public function getUserToRenderAs(

@Ambient-Impact Ambient-Impact added the enhancement New feature or request label Jul 22, 2022
@Ambient-Impact
Copy link
Member Author

Ambient-Impact commented Jan 14, 2023

Potential idea if it's not possible to render as a user that has not been saved to the database (i.e. a temporary user): create and save user accounts with the following traits:

  • Clearly labelled unique user account name and generated (non-existent) email address; e.g. "Changes render user N" / "[email protected]" ("N" being a counter for uniqueness; domain name should be taken from system.site.mail config).
  • Must be assigned the same role(s) as identified "real" user accounts it's the counterpart to.
  • Blocked so that no one can access it; this should theoretically still allow rendering?
  • Maybe provide some kind of warning if someone who can administer users tries to delete such an account so they know why they exist/are being created?

Additionally, it'll be a good idea to store a array/map of these generated user accounts so they can be easily retrieved. Perhaps they can be stored in the State API, along with a corresponding cache item which is assigned all the relevant cache tags (e.g. user:123, user:124, etc.) so that we know to rebuild the state entry if any of the accounts are modified or deleted.

@Ambient-Impact Ambient-Impact pinned this issue Jan 14, 2023
@Ambient-Impact Ambient-Impact changed the title Refactor changes rendering to generate temporary user accounts instead of using existing accounts Refactor rendering to generate temporary user accounts instead of using existing accounts Jan 14, 2023
@Ambient-Impact Ambient-Impact unpinned this issue Jan 23, 2023
@Ambient-Impact Ambient-Impact transferred this issue from neurocracy/drupal-omnipedia-changes Jan 24, 2023
@Ambient-Impact Ambient-Impact changed the title Refactor rendering to generate temporary user accounts instead of using existing accounts Refactor rendering to generate user accounts instead of using existing accounts Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant