vinaysaini Posted October 7, 2014 Share Posted October 7, 2014 (edited) Hi all, I am using prestashop 1.6.0.9 and there I have created one new admin controller. But when I go to that controller page in admin panel it shows me "Access denied". How can I solve this problem? Edited October 9, 2014 by vinaysaini (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 9, 2014 Share Posted October 9, 2014 can you show code of this controller please? also, how you access to controller page? you added some new menu item ? Link to comment Share on other sites More sharing options...
vinaysaini Posted October 9, 2014 Author Share Posted October 9, 2014 (edited) I have not created any menu. It is just a link with my new controller link {$link->getAdminLink('AdminCustomOrders')|escape:'html':'UTF-8'} I need to use some of the functionality of existing order controller. So I have copied AdminOrdersController controller and pasted in override folder with name changed to AdminCustomOrders and class name also I have changed to AdminCustomordersControllerCore. So the code is same as orders controller. Now it shows me access denied. I can give view access by putting new function in the controller, like below. public function viewAccess($disable = false) { return true; } But now the problem occurs with edit,delete or some other access. And I can not give permission through Administration -> Permission because my controller is not appearing there. So is there a good fix for it? Edited October 9, 2014 by vinaysaini (see edit history) Link to comment Share on other sites More sharing options...
cristic Posted October 9, 2014 Share Posted October 9, 2014 (edited) You have to add it as a Tab. This is how I'm doing this (in the install part of a module): $tab = new Tab(); $tab->active = 1; $languages = Language::getLanguages(false); if (is_array($languages)) foreach ($languages as $language) $tab->name[$language['id_lang']] = 'Custom Orders'; $tab->class_name = 'AdminCustomOrders'; $tab->module = $this->name; $tab->id_parent = - 1; $tab->add(); Edited October 9, 2014 by cristic (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now