fixed bug in creating user and returning parents of installations/folders

This commit is contained in:
Kim 2023-04-06 08:05:05 +02:00
parent 4b8c4f1942
commit 1021bb852a
2 changed files with 7 additions and 7 deletions

View File

@ -156,11 +156,11 @@ public static class SessionMethods
.WithParent(sessionUser) .WithParent(sessionUser)
.Do(() => newUser.Password = newUser.SaltAndHashPassword(newUser.Password)) .Do(() => newUser.Password = newUser.SaltAndHashPassword(newUser.Password))
.Do(() => newUser.MustResetPassword = true) .Do(() => newUser.MustResetPassword = true)
.Apply(Db.Create) .Apply(Db.Create);
&& Mailer.Mailer.SendVerificationMessage(newUser); // && Mailer.Mailer.SendVerificationMessage(newUser);
//Send Email to new user to verify email and set password //Send Email to new user to verify email and set password
} }
public static Boolean Update(this Session? session, User? editedUser) public static Boolean Update(this Session? session, User? editedUser)

View File

@ -182,9 +182,9 @@ public static class UserMethods
{ {
return other?.Type switch return other?.Type switch
{ {
"installation" => user.HasAccessTo(Db.GetInstallationById(other.ParentId)), "Installation" => user.HasAccessTo(Db.GetFolderById(other.ParentId)),
"user" => user.HasAccessTo(Db.GetUserById(other.ParentId)), "User" => user.HasAccessTo(Db.GetUserById(other.ParentId)),
"folder" => user.HasAccessTo(Db.GetFolderById(other.ParentId)), "Folder" => user.HasAccessTo(Db.GetFolderById(other.ParentId)),
_ => false _ => false
}; };
} }