nghi Posted May 14, 2014 Share Posted May 14, 2014 When I'm log in as the admin. I am able to see the Manage orders tabs at the top right. How would I give access to a guess user to view and edit orders? Super Userhttp://imgur.com/PkDbfbi Client user http://imgur.com/QkOLzUH Link to comment Share on other sites More sharing options...
nghi Posted May 15, 2014 Author Share Posted May 15, 2014 Oh figure it out =D! I added the permission in the installer and uninstaller function. Then on my client role I gave it the shop_orders permission. (You can also do it manually in the back end) public function install() { $permission = $this->permissions->get('shop_orders'); if (!$permission->id) { $p = new Permission(); $p->name = 'shop_orders'; $p->title = $this->_('view Order mangement'); $p->save(); } } public function uninstall() { $permission = $this->permissions->get('shop_orders'); if ($permission->id) { $permission->delete(); } } //Also needed to modified this line and added check_access $orders = $this->pages->find('template=sc-order,limit=20,sort=-created, check_access=0'); I didn't realize that you can set permission in modules in the getModuleInfo() public static function getModuleInfo() { return array( 'title' => 'Orders Management', 'summary' => 'Manage Shop orders', 'version' => 002, 'permanent' => false, 'singular' => true, 'permission' => 'shop_orders', <------- 'requires' => array( "ShoppingCart", "ShoppingCheckout" ) );} 1 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