Exemplo n.º 1
0
 function user_privileges_delete_all()
 {
     $user_privilege_model = new User_privileges_model();
     $user_privilege_service = new User_privileges_service();
     $privilege_service = new Privilege_service();
     $privilege_master_service = new Privilege_master_service();
     $user_service = new User_service();
     $user_model = new User_model();
     $user_model->set_id($this->input->post('user_id', TRUE));
     //setting the user id
     $user = $user_service->get_admin_by_id($user_model);
     $user_privilege_model->set_user_id($this->input->post('user_id', TRUE));
     $master_privileges = $privilege_master_service->get_privilege_master_by_system_code($this->input->post('system_code', TRUE));
     foreach ($master_privileges as $master_privilege) {
         $privileges = $privilege_service->get_privileges_by_master_privilege_assigned_for($master_privilege->privilege_master_code, $user->user_type);
         foreach ($privileges as $privilege) {
             $user_privilege_model->set_privilege_code($privilege->privilege_code);
             $user_privilege_service->delete_new_user_privilege_system($user_privilege_model);
         }
     }
     //adding the user piviledges based on the template
     echo 1;
 }
Exemplo n.º 2
0
 function load_Edit_user_profile()
 {
     $user_service = new User_service();
     $user_model = new User_model();
     //        $privilege_master_service = new Privilege_master_service();
     $user_model->set_id($this->session->userdata('USER_ID'));
     $data['user'] = $user_service->get_admin_by_id($user_model);
     //        $data['master_privileges'] = $privilege_master_service->get_all_master_privileges();
     echo $this->load->view('users/admin_profile_edit_view', $data);
 }