creating new folders and installations now gives you access to the new folder/installation

This commit is contained in:
Kim 2023-03-16 16:45:25 +01:00
parent 4eac790eaa
commit df65b48c8f
2 changed files with 7 additions and 6 deletions

View File

@ -48,7 +48,7 @@ public static class InstallationMethods
});
var x = await cmd.ExecuteBufferedAsync();
//Updating the url in the db as to not needing to wait until the next
//Updating the url in the db as not wait until the next bi-daily update
var cmd2 = Cli
.Wrap("python3")
.WithArguments(new[]
@ -82,7 +82,6 @@ public static class InstallationMethods
return x.ExitCode == 0;
}
public static IEnumerable<User> UsersWithAccess(this Installation installation)
{
return UsersWithDirectAccess(installation).Concat(UsersWithInheritedAccess(installation));

View File

@ -14,7 +14,8 @@ public static class SessionMethods
&& folder is not null
&& user.HasWriteAccess
&& user.HasAccessTo(folder.Parent())
&& Db.Create(folder);
&& Db.Create(folder)
&& Db.Create(new FolderAccess() { UserId = user.Id, FolderId = folder.Id });
}
public static Boolean Update(this Session? session, Folder? folder)
@ -50,7 +51,8 @@ public static class SessionMethods
&& user.HasWriteAccess
&& user.HasAccessTo(installation.Parent())
&& Db.Create(installation)
&& InstallationMethods.CreateBucket(installation).Result;
&& InstallationMethods.CreateBucket(installation).Result
&& Db.Create(new InstallationAccess { UserId = user.Id, InstallationId = installation.Id });
}
public static Boolean Update(this Session? session, Installation? installation)