public class UsersRoles
extends java.lang.Object
Constructor and Description |
---|
UsersRoles()
Public consructor of the class that initializes the map and retrieves
the roles and their rights from the database.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,int[]> |
getRoles() |
void |
insertToDatabase(java.lang.String role,
int str,
int prr,
int sur)
Creates a new role in the database.
|
void |
retrieveFromDatabase()
Retrieves from the database the roles and their rights and stores them into the map.
|
void |
setRoles(java.util.Map<java.lang.String,int[]> roles) |
void |
updateToDatabase(java.lang.String updateParam,
int newValue,
java.lang.String role)
Updates the desired rights of a role with a new value to the database.
|
public UsersRoles()
public java.util.Map<java.lang.String,int[]> getRoles()
public void setRoles(java.util.Map<java.lang.String,int[]> roles)
roles
- public void insertToDatabase(java.lang.String role, int str, int prr, int sur)
role
- The value of the role name.str
- The value for the storage rights.prr
- The value for the product rights.sur
- The value for the supplier rights.public void updateToDatabase(java.lang.String updateParam, int newValue, java.lang.String role)
updateParam
- The desired rights to be updated.newValue
- The new value of the desired rights.role
- The name of the role that will be updated.public void retrieveFromDatabase()