Skip to content

Plugin needs permissions to allow non-admins to use features (after SUPEE-6285) #24

Description

@ghost

Magento fixed a permissions bug in SUPEE-6285 where it didn't check permissions and set it so that only admins have access to plugins that don't have permissions set.

http://merch.docs.magento.com/ce/user_guide/Magento_Community_Edition_User_Guide.html#magento/patch-releases-2015.html

The only thing that we have non-admins doing is capturing from the orders page so I implemented the below code to fix it. I would submit a PR but I'm not sure if there are others things that should have permissions or if you wanted to do it a little bit differently.

app/code/local/Litle/CreditCard/controllers/Adminhtml/OrderController.php

protected function _isAllowed()
{
    return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/creditcard');
}

app/code/local/Litle/CreditCard/etc/config.xml

<adminhtml>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <sales>
                        <children>
                            <order>
                                <children>
                                    <actions>
                                        <children>
                                            <creditcard translate="title" module="creditcard">
                                                <title>Credit card capture (Litle)</title>
                                            </creditcard>
                                        </children>
                                    </actions>
                                </children>
                            </order>
                        </children>
                    </sales>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions