1

So I'm trying to write an ACL.XML file for a simple extension that we have that allows certain people to run a manual indexer.

However, all the documentation I can find says I should use:

<acl>
    <resources>
        <resource id="Magento_Backend::admin">
            <resource id="Magento_Backend::system">
                <resource id="Magento_Backend::system_tools">

However if I use that, then the role never fully loads.

But if I change it to:

            <resource id="Magento_Backend::tools">

Then it loads, and I can add it to my role (add a checkmark) and click save. No errors. However, when I go back to the role resources, it's unchecked.

I'm completely new to ACL's in M2, so I'm a little stumped.

Here is a fully copy and paste of my ACL.xml:

<?xml version="1.0"?>
<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="Magento_Backend::system">
                    <resource id="Magento_Backend::tools">
                        <resource id="ProductIndexer::productindexer" title="Manual Indexer" sortOrder="60"/>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

1 Answer 1

0

tools is correct, not system_tools, as you can see in the original acl.xml of the Magento_Backend module: https://github.com/magento/magento2/blob/2.1/app/code/Magento/Backend/etc/acl.xml#L39

But your own identifier ProductIndexer::productindexer is wrong. You cannot choose an arbitrary identifier, it must be in the form Vendor_Module::name (only the "name" part is arbitrary).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.