[MGNLEE-657] INT tests - Component restrictions are not working Created: 13/Sep/21  Updated: 19/Oct/21  Resolved: 04/Oct/21

Status: Closed
Project: Magnolia DX Core
Component/s: None
Affects Version/s: 6.2.11
Fix Version/s: 6.2.13

Type: Bug Priority: Neutral
Reporter: Lam Nguyen Bao Assignee: Lam Nguyen Bao
Resolution: Done Votes: 0
Labels: headless-team-support, maintenance
Remaining Estimate: Not Specified
Time Spent: 2.5h
Original Estimate: Not Specified

Issue Links:
Cloners
clones MGNLPN-583 Component restrictions are not working Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: UI framework implementation
Sprint: HL & LD 37, HL & LD 38
Story Points: 0

 Description   

Steps to reproduce

  1.  Go to our demo (as superuser) and at the Resources app, edit the /mtk/templates/components/html.yaml file
  2.  Regarding our docs, include the following snippet
    deletable: false
    writable: false
    moveable: false
    personalizable: false
  1. Login as eric and open a pager which has an HTML component within it
  2. Check only delete and move are restricted

Expected results

The editor can't edit, create component variants, delete or move the HTML component

Actual results

The editor can edit and create variants on the restricted HTML component

Workaround

The rules are implemented. Just missing in the configuration. Hotfix or decorate the config to add missing rules (not tested).

Development notes

Even including this restrictions on the pages.yaml file, the editor con edit and create variants on the HTML component:

main:
    availableComponents: # using all components from footer plus others
      <<: *footerAvailableComponents
      html:
        id: mtk:components/html
        permissions:
          write:
            roles: 
              superuser: superuser
          delete:
            roles:
              superuser: superuser
          move:
            roles:
              superuser: superuser
          add:
            roles:
              superuser: superuser
          personalize:
            roles: [superuser]

Generated at Mon Feb 12 05:32:05 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.