User Rights include 56:

This commit is contained in:
Ismail Ali
2025-05-25 11:20:35 +02:00
parent fc6a706769
commit 0d59fff439
4 changed files with 50 additions and 96 deletions

View File

@@ -84,10 +84,13 @@ export const handleEditPoi = (
return;
}
console.log("User Rights includes 56:", userRights.includes(56));
console.log(
"User Rights include 56:",
userRights.some((r) => r.IdRight === 56)
);
// Prüfung, ob der Benutzer die notwendigen Rechte hat
if (!userRights.includes(56)) {
if (!userRights.some((r) => r.IdRight === 56)) {
toast.error("Benutzer hat keine Berechtigung zum Bearbeiten.", {
position: "top-center",
autoClose: 5000,

View File

@@ -74,7 +74,7 @@ export const handleEditPoi = (
//console.log("User Rights:", userRights);
// Sicherstellen, dass userRights ein Array ist
if (!Array.isArray(userRights)) {
if (!userRights.some((r) => r.IdRight === 56)) {
console.error("User Rights is not an array:", userRights);
toast.error("Benutzerrechte sind ungültig.", {
position: "top-center",
@@ -88,7 +88,10 @@ export const handleEditPoi = (
return;
}
console.log("User Rights includes 56:", userRights.includes(56));
console.log(
"User Rights include 56:",
userRights.some((r) => r.IdRight === 56)
);
// Prüfung, ob der Benutzer die notwendigen Rechte hat
if (!userRights.some((r) => r.IdRight === 56)) {