From 63b67ddb8d512d96ff880623d604be4dde70ec10 Mon Sep 17 00:00:00 2001
From: Simon Leipold <s.leipold@adito.de>
Date: Tue, 14 Dec 2021 10:56:41 +0100
Subject: [PATCH] [Projekt: Entwicklung - Neon][TicketNr.:
 2002734][PermissionCalendar_lib imperformant aufgrund von
 tool-Profilaufrufen]

---
 process/PermissionCalendar_lib/process.js | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/process/PermissionCalendar_lib/process.js b/process/PermissionCalendar_lib/process.js
index 372f85e353..06116cc69c 100644
--- a/process/PermissionCalendar_lib/process.js
+++ b/process/PermissionCalendar_lib/process.js
@@ -4,7 +4,6 @@ import("system.db");
 import("system.project");
 import("system.plugin");
 import("system.translate");
-import("system.logging");
 import("AttributeRegistry_basic");
 import("Sql_lib");
 import("Employee_lib");
@@ -425,7 +424,7 @@ PermissionCalendar.getPermissions = function(pCurrentUser)
  */
 PermissionCalendar._getUser = function()
 {
-    users = tools.getUsersByAttribute(tools.ISACTIVE, ["true"], tools.PROFILE_FULL);
+    users = tools.getUsersByAttribute(tools.ISACTIVE, ["true"], tools.PROFILE_DEFAULT);
     return users.map(function (user)
     {
         return [
@@ -445,8 +444,7 @@ PermissionCalendar._getUser = function()
  */
 PermissionCalendar.getAllParents = function(pUserId) 
 {
-    let user = tools.getUsersByAttribute(tools.NAME, [pUserId], tools.PROFILE_FULL)[0];
-    
+    var user = tools.getUserByAttribute(tools.NAME, [pUserId], tools.PROFILE_DEFAULT);
     var departments = [];
     var department  = user[tools.PARAMS].department;
     while (department != null && department != "" && department != undefined)
-- 
GitLab