public class RightDAO
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private org.hibernate.Session |
ss |
Constructor and Description |
---|
RightDAO()
Constructor of the class - only thing to do here is to open session to DB
|
Modifier and Type | Method and Description |
---|---|
void |
closeSession()
Method for closing the session - it flushes database connection
|
void |
deleteRight(Right right)
Method providing functionality for deleting right
|
Right |
findRight(java.lang.String permission)
Method returning right that matches the permission given
|
java.util.List<Right> |
getAllRights()
Method returning list of all Rights
|
java.util.List<Right> |
getRightsByRole(java.lang.String role)
Method returning rights for given role
|
java.util.List<Right> |
getRightsByUser(java.lang.String username)
Method providing functionality for getting all rights for given user
|
java.lang.Boolean |
newRight(Right right)
Method providing functionality for creating new right
|
void |
updateRight(Right right)
Method providing functionality for updating right
|
public RightDAO()
public java.util.List<Right> getAllRights()
public java.util.List<Right> getRightsByUser(java.lang.String username)
username
- User whose rights should be returnedpublic java.util.List<Right> getRightsByRole(java.lang.String role)
role
- name of role whose rights are to be displayedpublic Right findRight(java.lang.String permission)
permission
- permission string that is being searched forpublic java.lang.Boolean newRight(Right right)
right
- Right to be createdpublic void updateRight(Right right)
right
- Right to be updatedpublic void deleteRight(Right right)
right
- Right to be deletedpublic void closeSession()