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

[2.1.0-ce] Role Resources not selectable #5803

Closed
ghost opened this issue Jul 26, 2016 · 14 comments
Closed

[2.1.0-ce] Role Resources not selectable #5803

ghost opened this issue Jul 26, 2016 · 14 comments
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@ghost
Copy link

ghost commented Jul 26, 2016

Preconditions

  1. CE 2.1.0, php 7.07, ubuntu 14.04, either Firefox or Safari latest stable version.

Steps to reproduce

  1. Login to Admin
  2. Create and save a new user role.
  3. Attempt to select appropriate resources for that role

Expected result

  1. Role resources should be displayed and selectable and savable.

Actual result

  1. No role resources are shown, selectable, or savable.

clip_3

@luantmindarc
Copy link

You can check file acl.xml in your module

@robkor
Copy link

robkor commented Sep 8, 2016

Exact the same issue in our Magento 2.1.0-CE. Upgraded from 2.0.7-CE.

I need to create a new role for a api-user to be used for a shipment interface. But first I have to correct an xml file? Where is that file to be found? In which module? What is the path?

Please enlighten me.

@TommyKolkman
Copy link

I need this too. Occurs in 2.1.1 as well.

@robkor
Copy link

robkor commented Oct 6, 2016

Hi @TommyKolkman

On a fresh install of 2.1.0-CE the role resources are correctly shown. The problem may be caused by a theme or module that is installed.

I used article #132329 on stackexchange to solve the issue for now.

In the file module_user/Block/Role/Tab/Edit.php, in the function getTree() I changed:
isset($resources[1]['children']) ? $resources[1]['children']
into:
isset($resources[2]['children']) ? $resources[2]['children']
and the resource tree is shown again.

@niclashoyer
Copy link

Can confirm this issue on an installation of 2.1.2-CE after Upgrade from 2.0.7 and 2.1.1. The temporary workaround from @robkor works.

@pguedesbr
Copy link

I had the same issue with the resources tree rendering blank, and I've found out that the issue was with the acl.xml file of one of the installed modules (it can also be from a theme).

In my case, the module's resources were not inside the Magento_Backend::admin resource tag:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
    <resources>
        <resource id="UOL_PagSeguro::Conciliation" title="Conciliation" sortOrder="10" />
        <resource id="UOL_PagSeguro::Abandoned" title="Abandoned" sortOrder="20" />
        <resource id="UOL_PagSeguro::Cancellation" title="Cancellation" sortOrder="30" />
        <resource id="UOL_PagSeguro::Refund" title="Refund" sortOrder="40" />
        <resource id="UOL_PagSeguro::Credentials" title="Credentials" sortOrder="50" />
    </resources>
</acl>
</config>

After making the changes such as placing the resources inside a group resource tag (one for all the module related resources), and also placing it inside the Magento_Backend::admin tag, fixed the problem.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
    <resources>
        <resource id="Magento_Backend::admin">
            <resource id="UOL_PagSeguro::admin" title="PagSeguro">
                <resource id="UOL_PagSeguro::Conciliation" title="Conciliation" sortOrder="10" />
                <resource id="UOL_PagSeguro::Abandoned" title="Abandoned" sortOrder="20" />
                <resource id="UOL_PagSeguro::Cancellation" title="Cancellation" sortOrder="30" />
                <resource id="UOL_PagSeguro::Refund" title="Refund" sortOrder="40" />
                <resource id="UOL_PagSeguro::Credentials" title="Credentials" sortOrder="50" />
            </resource>
        </resource>
    </resources>
</acl>
</config>

Finally, to find out the module/theme thats causing this issue, check their acl.xml files or try to disable one by one and check the roles & permissions page to see if the tree is visible again.

Remember to clear cache if you're not running in developer mode!

@fideliocc
Copy link

fideliocc commented Apr 17, 2017

I understand these are the custom modules located in app/code directory (?). There are also directories that don't contain the acl.xml file in custom-module-name/etc directory. It's necesary to add this file, or just to modify these lines where the file exists?

Thanks for your help.

@pguedesbr
Copy link

You dont need to create acl.xml files for modules that do not require one.
In those modules that do have acl.xml file, check their sintax as per my previous post and fix them accordingly.

@ThakurPradeep
Copy link

Thanks @robkor Working fine.

Magento ver 2.1.5

Problem: No role resources are shown, selectable, or savable.

  1. Admin -> System -> User Roles -> Add New Role -> Roles Resources

Solution : Open file and edit Edit.php
path : /vendor/magento/module-user/Block/Role/Tab/Edit.php

in the function getTree() I changed:
isset($resources[1]['children']) ? $resources[1]['children'] : []
into:
isset($resources[2]['children']) ? $resources[2]['children'] : []
and the resource tree is shown again.

  1. Admin -> System -> Extensions -> Integration -> Add New Integration -> API -> Resources

Solution : Open file and edit Webapi.php
path :/vendor/magento/module-integration/Block/Adminhtml/Integration/Edit/Tab/Webapi.php

in the function getTree() I changed:
isset($resources[1]['children']) ? $resources[1]['children'] : []
into:
isset($resources[2]['children']) ? $resources[2]['children'] : []
and the resource tree is shown again.

Thanks

@BlackIkeEagle
Copy link
Member

this is not a proper fix, but the develop branch has this issue fixed

66d1960 and 6b51259 are related to this

@oleg-onufer
Copy link
Contributor

Hi @dgarbe.
Unfortunately I could not reproduce this issue. May you please advise if this problem is still relevant for latest release Magento 2

@magento-engcom-team magento-engcom-team added bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Progress: needs update labels Sep 18, 2017
@magento-engcom-team
Copy link
Contributor

@dgarbe, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.1.9

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Sep 21, 2017
@Brendonwbrown
Copy link

I have this issue after upgrade to 2.1.9.

magento-engcom-team pushed a commit that referenced this issue Jun 17, 2020
@KowsiganAtsayam
Copy link

i am also having this issue in magento 2.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests