Ejemplo n.º 1
0
Archivo: role.php Proyecto: trk/ionize
 /**
  * Edit
  *
  */
 public function edit()
 {
     $role = $this->role_model->get($this->input->post('id_role'));
     $this->template['role'] = $role;
     // Get roles list
     // TODO: Filter roles on level ?
     $roles = $this->role_model->get_list();
     $this->template['roles'] = array_filter($roles, array($this, '_filter_roles'));
     // All Admin Resources
     $resources = $this->resource_model->get_tree();
     $this->template['json_resources'] = json_encode($resources, TRUE);
     // All Modules Resources
     $modules_resources = Modules()->get_resources();
     $resources = $this->resource_model->build_resources_tree($modules_resources);
     $this->template['json_modules_resources'] = json_encode($resources, TRUE);
     // Role's permissions
     $rules = $this->rule_model->get_list(array('id_role' => $role['id_role']));
     $this->template['has_all'] = $this->_has_all_permissions($rules);
     $this->template['json_rules'] = json_encode($rules, TRUE);
     $this->output('role/edit');
 }