Magento2: Admin role scopes set to custom breaks backend

Created on 21 Apr 2017  路  6Comments  路  Source: magento/magento2

When the admin role scope is set to custom instead to all several things won't work, like saving product attributes, editing CMS content or editing admin users.

Preconditions

  1. Magento CE 2.1.4 fresh installation

Steps to reproduce

  1. Edit an admin user role and switch its role scope to custom
  2. Save the role

Expected result

  1. The role works as configured (on custom scope)

Actual result

  1. The role does not work as configured
  2. You won't see the roles nor the admin users anylonger
  3. If you open a product attribute in the backend, the save button is missing
  4. If you want to edit a cms page the following mysql error appears:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'store.store_id' in 'where clause', query was: SELECT `main_table`.*, `page_table`.`title` AS `page_title`, `page_table`.`identifier` AS `page_identifier`, IF(clone.node_id IS NULL, 0, 1) AS `page_exists`, IF(main_table.page_id = '2', 1, 0) AS `current_page`, (SELECT GROUP_CONCAT(stor
e_id SEPARATOR ',') AS `store_id` FROM `cms_page_store` AS `store` WHERE (store.row_id = main_table.page_id)) AS `page_in_stores` FROM `magento_versionscms_hierarchy_node` AS `main_table`
 LEFT JOIN `cms_page` AS `page_table` ON main_table.page_id = page_table.page_id AND (page_table.created_in <= 1 AND page_table.updated_in > 1)
 LEFT JOIN `magento_versionscms_hierarchy_node` AS `clone` ON main_table.node_id = clone.parent_node_id AND clone.page_id = '2' WHERE (store.store_id IN (0, '1')) HAVING (main_table.page_id IS NULL OR page_in_stores IS NOT NULL) ORDER BY `main_table`.`level` ASC, `main_table`.`sort_order` ASC
Clear Description Format is valid bug report

Most helpful comment

I do not know if this is an Enterprise bug only :-) That's why we are reporting it. You can handle it the way you want to handle bugs. I am just reporting what I see :-)

All 6 comments

@sydekumf We cannot reproduce this issue as described. Please provide the detailed steps we must follow to reproduce this issue. In addition, identify the web server you are running, the versions of PHP and MySQL, and any other information needed to reproduce your issue.

I'm experiencing the same issue, check attachments. Create an admin role with Role Scope to one store only. Try to add a CMS Page.
screen shot 2017-07-10 at 8 21 18 am
screen shot 2017-07-10 at 8 20 33 am

@iainhubbard @sydekumf Thanks for reporting this issue. If this issue is actual for Enterprise Edition only, please address it to Magento Support.

I do not know if this is an Enterprise bug only :-) That's why we are reporting it. You can handle it the way you want to handle bugs. I am just reporting what I see :-)

I there any way to set the role scopes back to "all"?

ANSWER: I manipulated the DB:

Table: authorization_role
Fields:

gws_is_all (1 is "all")
I also suggest setting "gws_websites = null" and "gws_store_groups = null" where gws_is_all = 1

@sydekumf thank you for your report. Please follow these guidelines for proper tracking of your issue. You can report Commerce-related issues in one of two ways:
You can use the Support portal associated with your account
or
If you are a Partner reporting on behalf of a merchant, use the Partner portal.

GitHub is intended for Magento Open Source users to report on issues related to Open Source only. There are no account management services associated with GitHub.

Was this page helpful?
0 / 5 - 0 ratings