Revisit permissions required to view contact messages

Created on 18 April 2016, about 9 years ago
Updated 18 August 2024, 8 months ago

Problem/Motivation

At present we use 'administer contact forms' to govern access to viewing/editing contact messages.

However this is too generic.

We should look into adding 'view', 'delete' and 'edit' permissions for contact messages.

Possibly on a per-form basis. See ✨ Per form based access permissions Needs work for that.

Proposed resolution

Decide on best permission set.
Patch.
Review.

Remaining tasks

Everything.

User interface changes

None

API changes

None

Data model changes

None

πŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡΅πŸ‡±Poland adpo

    Also tested #62 but I don't see any permission setting I'm afraid. I have run update.php and cleared the cache.

    Is there anything else I need to do?

  • Merge request !17Issue 2708809: Permissions β†’ (Open) created by berdir
  • Status changed to Needs work 8 months ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    Sorry for letting this sit so long, still applies but will need some updates for tests to work.

    contact_storage_entity_type_alter() has a todo to add an access control handler, not sure if it's worth adding one, but we should at least remove that todo.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    darren.fisher β†’ made their first commit to this issue’s fork.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 263s
    #456015
  • Pipeline finished with Failed
    about 1 month ago
    Total: 167s
    #456099
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    As a result of trying to fix some gitlab-ci test failures I've discovered via cspell that there is a misspelling which I'd be reluctant to change:

    Cspell turned up:
    constact

    in contact_storage.module:

    $fields['message']->addConstraint('ConstactStorageMaximumSubmissions', []);
    

    in src/Plugin/Validation/Constraint/ConstactStorageMaximumSubmissionsConstraint.php:

    class ConstactStorageMaximumSubmissionsConstraint extends Constraint {
    

    in src/Plugin/Validation/Constraint/ConstactStorageMaximumSubmissionsConstraintValidator.php:
    class ConstactStorageMaximumSubmissionsConstraintValidator extends ConstraintValidator {

    These should surely be ContactStorageMaximumSubmissions, ContactStorageMaximumSubmissionsConstraint, and ContactStorageMaximumSubmissionsConstraintValidator respectively?

    I'm pretty sure changing these now could have side effects so I will leave these alone.

    Annoyingly I've just spotted there is already a phpcs issue in the queue that likely resolves any phpcs issues I've just cleanup up in here. Apologies. My bad. Should have looked first!

    The PHPUnit failure is a bit beyond me and there are still a ton of phpstan issues. Hopefully this helped and didn't muddy the waters!

  • Pipeline finished with Failed
    about 1 month ago
    Total: 725s
    #456152
Production build 0.71.5 2024