Set Opencart Custom Page Access For User Group – Opencart
- Article
- Comment (7)
Set Opencart Custom Page Access For User Group. Before getting into this topic, if you want to set the Access permission manually than read this article. Which will help you to set permission for your Custom directory,
If you are seeking it to do the operation on programmatically for your opencart site, read the rest of the tutorial. Here I just wrote an sample Controller class to explain you,
<?php class ControllerKvTestPermissions extends Controller { public function index() { $this->redirect($this->url->link('kvc/permissions', 'token=' . $this->session->data['token'], 'SSL')); } public function install() { $this->load->model('user/user_group'); $this->model_user_user_group->addPermission($this->user->getId(), 'access', 'kvc/permissions'); $this->model_user_user_group->addPermission($this->user->getId(), 'modify', 'kvc/permissions'); } } ?>
The above class describes you to set access permission for “kvc/permissions“. Just use this codes to create your Custom page and include it with this code.
i m not getting the timezone as per my country(india)…
Help me out guys…………
Thanx in advance….
i installed additional module but we can do it but we can do it by changing the code also ..not getting the timezone as per my country.(india)…….
how solve the problems plz help me ……..
Good day . I use opentsart Version 2.0.3.1 . I can not set the permission programmatically . where I have to use your code?
the code i described is for OC 1.5.5. Not sure it will work on 2 above.
this works in version 1.5.6.4 ? permission denied
It will work on OC 1.5.6.4.
Hi Varadhraj,
I have installed opencart 2.2 and i am new to opencart i have made an admin page folloiwng your tutorilas code but still i have a permission deined error.
Any idea will be waiting for you.
Thanks,Saeed
Sorry, have not update my tutorial to the new version. Which is for 1.5 version