From 1021bb852afd78b5bc14e77466b9479e5ad2919f Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 6 Apr 2023 08:05:05 +0200 Subject: [PATCH] fixed bug in creating user and returning parents of installations/folders --- csharp/App/Backend/DataTypes/Methods/Session.cs | 8 ++++---- csharp/App/Backend/DataTypes/Methods/User.cs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/csharp/App/Backend/DataTypes/Methods/Session.cs b/csharp/App/Backend/DataTypes/Methods/Session.cs index d3e599ebc..c0e6b3e33 100644 --- a/csharp/App/Backend/DataTypes/Methods/Session.cs +++ b/csharp/App/Backend/DataTypes/Methods/Session.cs @@ -156,11 +156,11 @@ public static class SessionMethods .WithParent(sessionUser) .Do(() => newUser.Password = newUser.SaltAndHashPassword(newUser.Password)) .Do(() => newUser.MustResetPassword = true) - .Apply(Db.Create) - && Mailer.Mailer.SendVerificationMessage(newUser); - + .Apply(Db.Create); + // && Mailer.Mailer.SendVerificationMessage(newUser); + //Send Email to new user to verify email and set password - + } public static Boolean Update(this Session? session, User? editedUser) diff --git a/csharp/App/Backend/DataTypes/Methods/User.cs b/csharp/App/Backend/DataTypes/Methods/User.cs index f20ae6b87..2ce43c2e9 100644 --- a/csharp/App/Backend/DataTypes/Methods/User.cs +++ b/csharp/App/Backend/DataTypes/Methods/User.cs @@ -182,9 +182,9 @@ public static class UserMethods { return other?.Type switch { - "installation" => user.HasAccessTo(Db.GetInstallationById(other.ParentId)), - "user" => user.HasAccessTo(Db.GetUserById(other.ParentId)), - "folder" => user.HasAccessTo(Db.GetFolderById(other.ParentId)), + "Installation" => user.HasAccessTo(Db.GetFolderById(other.ParentId)), + "User" => user.HasAccessTo(Db.GetUserById(other.ParentId)), + "Folder" => user.HasAccessTo(Db.GetFolderById(other.ParentId)), _ => false }; }