title: Look for a role-based authentication solution in java
body: <p>I am building a project which is related to the user authentication.</p>
  
  <p>The project is about the task manager for the company.</p>
  
  <p>The company contain many departments,and one department may contain more than one sub_department,the sub_department can have sub departments also.</p>
  
  <p>The manager of one department can create/modify/remove tasks of his department. </p>
  
  <p>Other people can only see the task. </p>
  
  <p>When he create a task,he should specify the operator(who will make the job) and the charger(who will be responsible for the task). The operator and charger should belong to some specified departments.</p>
  
  <p>For example,there is one department named "department01"and this department contain two sub-departments:"development",and "design".</p>
  
  <p>Now user "John" is the manager of "development",so he can add task belong to "development",and choose operators and chargers belong to "department01" since the "department01" is the parent of "development".</p>
  
  <p>Also there are some other roles in the system,for example, the boss of "department01",he can see all the tasks belong to "department01" (contain tasks of "development" and "design").</p>
  
  <p>In this case, I think the role-based authentication is better.</p>
  
  <p>But I do not found any related information in java,so I ask if there is any example? </p>