views:

181

answers:

1

How can I change the "Access Denied" page/copy that is displayed in the magento admin when you try to do things outside of your reach?

I'd like to change the copy a bit.

Any ideas?

+1  A: 

The Access Denied error you'll get in the Admin doesn't come from an HTML page, it's an exception that's generated with the following code

File: app/code/core/Mage/Admin/Model/User.php
Mage::throwException(Mage::helper('adminhtml')->__('Access Denied.'));      

If you really want to change this text, I'd recommend one of two approaches.

The first would be to override the 'Access Denied.' key for your locale. You'd be tricking the system by telling it that the key 'Access Denied.' should be translated as [your message here]. The drawback here is I'm not sure if community edition actually refers to the locale file for en_US.

The second approach would be to override the __ method of the Mage_Adminhtml_Helper_Date class. If the text that gets passed to this method is anything but 'Access Denied.', then pass the call onto the original class (parent::__(...)). The the text IS 'Access Denied.', drop your custom message in there.

Alan Storm
That is exactly what I was looking for. Thanks again.
Tegan Snyder