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

VACMS-15492: Allow Content Admins to view Content Model Reports #15493

Conversation

davidmpickett
Copy link
Contributor

@davidmpickett davidmpickett commented Oct 2, 2023

Description

Relates to #15492.

Testing done

Screenshots

Screenshot 2023-10-02 161424

Screenshot 2023-10-02 161513

QA steps

What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?

As user uid with user_role

  1. Do this
    • Validate that
  2. Then
    • Validate that
  3. Then validate Acceptance Criteria from issue
    • a
    • b
    • c

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

@davidmpickett davidmpickett linked an issue Oct 2, 2023 that may be closed by this pull request
12 tasks
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 2, 2023 19:28 Destroyed
@davidmpickett
Copy link
Contributor Author

After first commit, I am able to log into Tugboat instance as a Content Admin and see Content Model Documents under the Structure Menu and also as a tab when Editing Vocabularies. May have to do something else to add reports to my menu.

Screenshot 2023-10-02 161424

Screenshot 2023-10-02 161513

@davidmpickett
Copy link
Contributor Author

I can navigate to the content model reports with URL even though they don't appear in nav bar
Screenshot 2023-10-02 162914

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 2, 2023 22:10 Destroyed
@davidmpickett
Copy link
Contributor Author

Giving the Content Admin role the System / access site reports permission added Reports to my Toolbar, but it also now shows me a bunch of reports other than the Content Model Documentation ones.

Screenshot 2023-10-02 172042

@davidmpickett
Copy link
Contributor Author

And then I went down the rabbit hole and realized that this is documented issue in core https://www.drupal.org/node/1635646

@davidmpickett
Copy link
Contributor Author

I might be vastly oversimplifying here but seems like we just need to add a new permission to https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/system/system.permissions.yml
and then update https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/system/system.routing.yml to use that new permission to control viewing the reports Menu in toolbar without ALSO granting access to dblogs

system.admin_reports:
path: '/admin/reports'
defaults:
_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
_title: 'Reports'
requirements:
_permission: 'access site reports'

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 2, 2023 23:30 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 2, 2023 23:30 Destroyed
@swirtSJW
Copy link
Contributor

swirtSJW commented Oct 3, 2023

I have no objection to granting content-admin access to all those things. But it is for CMS team to decide.

This part seems a bit... odd patches/system.routing.yml
We apply patches with composer so should not be able to just add them here and have them work.

@swirtSJW
Copy link
Contributor

swirtSJW commented Oct 3, 2023

Giving content-admin access to reports would also make it easier to move some of our "reports" out of 'admin/content/*' and into the reports namespace where they actually belong.

Reports are handy for all users.... could easily see this stretch to content publishers and maybe all users.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 7, 2023 15:53 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 27, 2023 23:45 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 27, 2023 23:55 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 27, 2023 23:56 Destroyed
@davidmpickett
Copy link
Contributor Author

Thanks for the feedback @swirtSJW. I think I got a little over ambitious here and tried to solve a much deeper problem than the one I originally scoped. I'm slimming this down to just focus on granting Content Admins the ability to view Content Model Documents & Reports without touching the Reports toolbar issue. That would probably warrant its own issue (and a more experienced Drupal developer than me) to properly resolve

@davidmpickett
Copy link
Contributor Author

On tugboat, I am able to log in as a Content Admin and access Content Model Documents and Content Model Reports!

screencapture-cms-mcg0n7eeoph0iyykadvi64hdh9gnwamf-ci-cms-va-gov-admin-structure-types-manage-centralized-content-document-2023-10-27-19_03_19

screencapture-cms-mcg0n7eeoph0iyykadvi64hdh9gnwamf-ci-cms-va-gov-admin-reports-content-model-2023-10-27-19_04_00

@davidmpickett davidmpickett marked this pull request as ready for review October 28, 2023 00:08
@davidmpickett davidmpickett marked this pull request as draft October 28, 2023 00:09
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.

Allow Content Admins to view Content Model Documents & Reports
3 participants