From 2ff870200e1fef3b21c6eb4e8af335284e14073e Mon Sep 17 00:00:00 2001 From: Breixo Senra Date: Sun, 26 Oct 2025 20:56:31 +0100 Subject: [PATCH] =?UTF-8?q?Menu.xhtml=20a=C3=B1adido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uvigo/esei/xcs/jsf/LoginManagedBean.java | 10 ++++++ jsf/src/main/webapp/vet/menu.xhtml | 33 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 jsf/src/main/webapp/vet/menu.xhtml diff --git a/jsf/src/main/java/es/uvigo/esei/xcs/jsf/LoginManagedBean.java b/jsf/src/main/java/es/uvigo/esei/xcs/jsf/LoginManagedBean.java index 07fd245..0811017 100644 --- a/jsf/src/main/java/es/uvigo/esei/xcs/jsf/LoginManagedBean.java +++ b/jsf/src/main/java/es/uvigo/esei/xcs/jsf/LoginManagedBean.java @@ -52,6 +52,8 @@ public class LoginManagedBean { return redirectTo(this.getAdminViewId()); } else if (this.isOwner()) { return redirectTo(this.getOwnerViewId()); + } else if (this.isVet()) { + return redirectTo(this.getVetViewId()); } else { return redirectTo(this.getViewId()); } @@ -88,6 +90,10 @@ public class LoginManagedBean { return "/admin/owners.xhtml"; } + private String getVetViewId() { + return "/vet/menu.xhtml"; + } + private boolean isAdmin() { return this.isUserInRole("ADMIN"); } @@ -96,6 +102,10 @@ public class LoginManagedBean { return this.isUserInRole("OWNER"); } + private boolean isVet() { + return this.isUserInRole("VET"); + } + private boolean isUserInRole(String role) { return FacesContext.getCurrentInstance().getExternalContext() .isUserInRole(role); diff --git a/jsf/src/main/webapp/vet/menu.xhtml b/jsf/src/main/webapp/vet/menu.xhtml new file mode 100644 index 0000000..59547d1 --- /dev/null +++ b/jsf/src/main/webapp/vet/menu.xhtml @@ -0,0 +1,33 @@ + + + + + Vet Menu + + + + +

Menu

+
Bienvenido al menú de gestión de veterinarios:
+
+ + + + + + + + + + +
+ + -- 2.18.1