title: Spring Hibernate problems
body: <p>I have a problem. I want to add option, where admin user can delete users accounts and can not delete admin accounts, but I can't do this. I tried to do it like this</p>
  
  <pre><code>@RequestMapping("/adminRemoveUser/{id}")
      public String removeUser(@PathVariable("id") int id){
          if(this.userService.getUserById(id).getUserRole().contains("ROLE_ADMIN")){
              return "errorDeleteUser";
          }
          else{
              this.userService.removeUser(id);
              if(this.userService.getPage(pageNumber).size()==0)
                  pageNumber--;
              return "redirect:/adminuserspage="+pageNumber;
          }
  }
  </code></pre>
  
  <p>but it doesn't works. Please help ;)</p>
  
  <p>Here's <a href="https://github.com/dominik04u/SpringHibernate.git" rel="nofollow">link</a> to the repo.</p>