in user profiles, restrict visibility of links for new users #1501
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.
Fixes #1500.
sanitize
only accepts an allow list, so I couldn't express "allow anything we normally do, excepta
". I instead blocked all attributes, so thehref
doesn't work and thus thea
doesn't render. There might be a more elegant way to do this; writing a custom sanitizer seemed like overkill and I didn't figure out anything else from Rails doc.This strips links if the viewer is not logged in and the profile user does not have "participate everywhere". Note for testing: in a new dev environment users come in with that ability by default, so remember to suspend it for your test user.
Screenshots: