creating new folders and installations now gives you access to the new folder/installation
This commit is contained in:
parent
4eac790eaa
commit
df65b48c8f
|
@ -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[]
|
||||
|
@ -81,8 +81,7 @@ public static class InstallationMethods
|
|||
var x = await cmd.ExecuteBufferedAsync();
|
||||
return x.ExitCode == 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static IEnumerable<User> UsersWithAccess(this Installation installation)
|
||||
{
|
||||
return UsersWithDirectAccess(installation).Concat(UsersWithInheritedAccess(installation));
|
||||
|
|
|
@ -9,12 +9,13 @@ public static class SessionMethods
|
|||
public static Boolean Create(this Session? session, Folder? folder)
|
||||
{
|
||||
var user = session?.User;
|
||||
|
||||
|
||||
return user is not null
|
||||
&& 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)
|
||||
|
|
Loading…
Reference in New Issue