Roles y User al 90%:

-Front-End Completo.
-Falta conectar Roles con Access
-Errores menores
This commit is contained in:
Araozu 2018-06-15 19:36:28 -05:00
parent 874c45b5b4
commit ca8dae036b

View File

@ -14,6 +14,23 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
/**
* RolesControllerView
*
* Permite ver los Roles
*
* Metodos importantes:
*
* public static getAllRoles()
* Devuelve un List<Role> con todos los roles que existen.
*
* public static getRole(String key)
* Devuelve un Rol dada una key.
* La key se obtiene usando el metodo getKey() de un objeto Role
*
* */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class RolesControllerView extends HttpServlet { public class RolesControllerView extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
@ -84,7 +101,7 @@ public class RolesControllerView extends HttpServlet {
return users; return users;
} }
static Role getRole(String key){ public static Role getRole(String key){
PersistenceManager pm = controller.PMF.get().getPersistenceManager(); PersistenceManager pm = controller.PMF.get().getPersistenceManager();
Key k = KeyFactory.stringToKey(key); Key k = KeyFactory.stringToKey(key);
Role role = pm.getObjectById(Role.class, k); Role role = pm.getObjectById(Role.class, k);