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

Introduce granulated Media Gallery ACL resources and enforce for new media gallery #1487

Closed
sivaschenko opened this issue Jun 16, 2020 · 2 comments · Fixed by magento/magento2#29715
Assignees
Labels
Backend Complex Frontend/UI Priority: P2 Should be fixed as early as possible Severity: S2 Affects non-critical data or functionality and forces users to employ a workaround
Milestone

Comments

@sivaschenko
Copy link
Member

sivaschenko commented Jun 16, 2020

Story #1485

Description

Use Magento_MediaGallery::media_gallery ACL resource instead of Magento_Cms::media_gallery
The Magento_MediaGallery::media_gallery ACL resource should have the following subresources:
** Upload assets
** Delete assets
** Insert assets into the content
** Create folder
** Delete folder

The resources should be added to app/code/Magento/MediaGallery/etc/acl.xml file in magneto2 repo
The introduced ACL resources should be enforced for the new media gallery (Enhanced Media Gallery is enabled)
The ACL resources should affect if corresponding buttons/components are displayed to the user and if the controllers/services accept the actions

@m2-assistant
Copy link

m2-assistant bot commented Jun 16, 2020

Hi @sivaschenko. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@sivaschenko sivaschenko changed the title Add granulated ACL resources for Enhanced Media Gallery Introduce granulated Media Gallery ACL resources Jun 16, 2020
@sivaschenko sivaschenko changed the title Introduce granulated Media Gallery ACL resources Introduce granulated Media Gallery ACL resources and enforce for old media gallery Jun 16, 2020
@lenaorobei lenaorobei removed this from the 2.1.0 milestone Jun 26, 2020
@sivaschenko sivaschenko added this to the 2.2.0 milestone Jul 29, 2020
@lenaorobei lenaorobei removed this from the 2.2.0 milestone Aug 3, 2020
@sivaschenko sivaschenko added this to the 2.1.0 milestone Aug 9, 2020
@sivaschenko sivaschenko added Priority: P2 Should be fixed as early as possible Severity: S2 Affects non-critical data or functionality and forces users to employ a workaround labels Aug 10, 2020
@sivaschenko sivaschenko added Priority: P4 Fixing can be deferred as a logical part of more important work and removed Priority: P2 Should be fixed as early as possible labels Aug 12, 2020
@lenaorobei lenaorobei changed the title Introduce granulated Media Gallery ACL resources and enforce for old media gallery [2.1-develop] Introduce granulated Media Gallery ACL resources and enforce for old media gallery Aug 12, 2020
@lenaorobei lenaorobei removed this from the 2.1.0 milestone Aug 12, 2020
@sivaschenko sivaschenko added Priority: P2 Should be fixed as early as possible and removed Priority: P4 Fixing can be deferred as a logical part of more important work labels Aug 17, 2020
@sivaschenko sivaschenko changed the title [2.1-develop] Introduce granulated Media Gallery ACL resources and enforce for old media gallery [2.1-develop] Introduce granulated Media Gallery ACL resources and enforce for new media gallery Aug 24, 2020
@sivaschenko sivaschenko added this to the 2.1.1 milestone Aug 25, 2020
@sivaschenko sivaschenko changed the title [2.1-develop] Introduce granulated Media Gallery ACL resources and enforce for new media gallery Introduce granulated Media Gallery ACL resources and enforce for new media gallery Aug 31, 2020
@tuyennn
Copy link
Member

tuyennn commented Dec 29, 2021

Got this issue on several projects

Unable to apply data patch Magento\MediaGalleryUi\Setup\Patch\Data\AddMediaGalleryPermissions for module Magento_MediaGalleryUi. Original exception message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (xxxxx.authorization_rule, CONSTRAINT AUTHORIZATION_RULE_ROLE_ID_AUTHORIZATION_ROLE_ROLE_ID FOREIGN KEY (role_id) REFERENCES authorization_role (role_id) ON DELETE CASCADE), query was: INSERT  INTO authorization_rule (role_id,resource_id,permission) VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)

The setup cannot pass, until this patch was applied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Complex Frontend/UI Priority: P2 Should be fixed as early as possible Severity: S2 Affects non-critical data or functionality and forces users to employ a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants