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

Mark some Comment permissions as restricted #5554

Closed
ghost opened this issue Mar 18, 2022 · 21 comments · Fixed by backdrop/backdrop#4163
Closed

Mark some Comment permissions as restricted #5554

ghost opened this issue Mar 18, 2022 · 21 comments · Fixed by backdrop/backdrop#4163

Comments

@ghost
Copy link

ghost commented Mar 18, 2022

In working on #5536, I noticed that while permissions like Administer content are restricted (they have the security warning), equivalent Comment permissions aren't.

IMO, the following Comment permissions should be restricted:

  • Administer comments
  • Administer comment settings - allows approving and deleting comments
  • Skip comment approval - allows bypassing approval process
  • Edit own comments - allows getting approval for a comment, but then changing it to say something else afterwards (also bypassing approval)

Thoughts?

@kiamlaluno
Copy link
Member

I agree: Those permissions should not given to every user (generally speaking). The warning is worth adding it.
Clearly, depending from the community the site is built for, it would be acceptable to give the Skip comment approval permission to any user with an account, but that is something the user building the site needs to evaluate. Those warning should not be takes as Never give this permission. but Think before giving this permission.

@argiepiano
Copy link

Thank you for the PR @kiamlaluno! I've left a couple of language suggestions in the PR.

@olafgrabienski
Copy link

Hey @kiamlaluno - thanks for your PR! In Backdrop we try to avoid the term "user" for people, or: we try to use the term only for user accounts. How to replace "user", depends on context. E.g., a phrase like the following:

Users could post spam or offensive comments that become immediately visible to every user.

... can be changed to something like:

People could post spam or offensive comments that become immediately visible to every visitor.

It would be great if you could look for "user" alternatives in your PR.

@kiamlaluno
Copy link
Member

kiamlaluno commented Aug 13, 2022

I didn't forget this issue: I am checking what phrase is used by Backdrop in these cases. immediately visible to every visitor seems correct to me, as the comment would probably be visible to anonymous users too (except in the case they don't have the permission to see comments). People could post spam or offensive comments sounds strange to me, as it seems to generally speak of people, not people who has an account on the site (who would be users).

@kiamlaluno
Copy link
Member

Looking at the permission descriptions, user and users are used words.

Allows a user to configure patterns for automated URL aliases and bulk delete URL aliases.

Determines whether or not users are shown a notice when an automatic URL alias changes.

The first example says allows a user, but it should be probably be allows users, since it's not a permission a single user has, but all the users with a specific role.

@kiamlaluno
Copy link
Member

I updated the warning sentences to make them similar to other warning sentences used by other modules. In this way, I avoided to use users.

@olafgrabienski
Copy link

olafgrabienski commented Aug 15, 2022

Thanks for the update, @kiamlaluno . I like the phrases you found, e.g. Allows to edit already approved comments instead of Users could edit ....

Update: also tested in the sandbox, works for me

@klonos
Copy link
Member

klonos commented Aug 21, 2022

Thank you @kiamlaluno 🙏🏼 ...I've left some suggestions in the PR. Mainly changing "Allows to do..." to "Allows doing...", as it seems to be the correct way to use the verb "allow" in those cases (see https://english.stackexchange.com/questions/60271/grammatical-complements-for-allow/60285#60285). I hope I'm not misinterpreting things.

Can others (preferably those with English as their primary language) have a look at the PR and chime in?

@jenlampton
Copy link
Member

jenlampton commented Sep 16, 2022

The permission restrict access option is intended to be used for only the most dangerous permissions. Here's the description from the documentation:

This should be used for permissions that have inherent security risks across a variety of potential use cases (for example, the "administer filters" and "bypass node access" permissions provided by Backdrop core).

It should be added to Administer comments and Administer comment settings, but Skip comment approval and Edit own comments wouldn't qualify.

I do think we can also improve those permissions by being more specific in their titles and/or descriptions, however, and I like the recommendations provided. I'll review the PR tomorrow and see if I can help with the grammar.

@jenlampton
Copy link
Member

I reviewed the PR and all the grammar looks great 👍

The description for Skip comment approval still needs work, and I put another suggestion on the PR:

Allows comments to be posted without approval, becoming immediately visible to everyone. Because spam and offensive comments are common, this permission should only be granted to those who are trusted, or on a site with additional spam protection measures in place.

This is probably way too long... what if we updated both the title and the description?

title: Skip comment approval: comments will be immediately visible to everyone.
description:
Because spam and offensive comments are common, this permission should only be granted to those who are trusted, or on a site with additional spam protection measures in place.

Hm, that probably still needs work.

@kiamlaluno
Copy link
Member

I changed the code as suggested. I hope I understood correctly.

@jenlampton jenlampton added this to the 1.24.3 milestone Apr 19, 2023
@klonos klonos modified the milestones: 1.24.3, 1.25.1 Jun 6, 2023
@quicksketch quicksketch modified the milestones: 1.25.1, 1.25.2 Jun 7, 2023
@quicksketch quicksketch modified the milestones: 1.25.2, 1.26.1 Sep 15, 2023
@quicksketch quicksketch modified the milestones: 1.26.1, 1.26.2 Oct 6, 2023
@kiamlaluno
Copy link
Member

I have updated the PR. The failing tests are the usual ones, not related with the changes introduced here.

@stpaultim
Copy link
Member

I've marked this "WFM." `

I see that earlier langage about SPAM has been removed. I think it's good either way. I would mark this RTBC, but I think it's better that someone else look at the code first. Personally, I'm not sure what the new 'restrict access' => TRUE, statement is doing.

@herbdool
Copy link

herbdool commented Jan 2, 2024

LGTM

@kiamlaluno
Copy link
Member

kiamlaluno commented Jan 2, 2024

I have synchronized the PR with the 1.x branch. Tests are running right now. CSpell complains about the new words introduced with CKEditor 5.

@quicksketch
Copy link
Member

Thanks @kiamlaluno for your continued effort to make this change happen. I merged backdrop/backdrop#4163 into 1.x and 1.26.x.

backdrop/backdrop@9a463a2 by @kiamlaluno, @stpaultim, @jenlampton, @klonos, @herbdool, @argiepiano, @olafgrabienski, and @BWPanda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants