load->model( $models ); $this->load->library( $libraries ); } public function index() { } public function getRoleAuthorisations() { $roleAuthorisations = Role::getPagesAccessByRole(); $this->json( $roleAuthorisations ); } public function toggleAuhorisation() { $pageID = $this->clean_input( 'pageID' ); $roleLevel = $this->clean_input( 'roleLevel' ); $access = $this->clean_input( 'access' ); $page = Page::find( $pageID ); if ( $access == 'F' ) $roleLevel = - $roleLevel; $page->pagelevel = $page->pagelevel + $roleLevel; $page->save(); } }