adds newly created inst and folders to accessible
This commit is contained in:
parent
2fdd920572
commit
2703dd1e11
|
@ -252,13 +252,9 @@ public class Controller
|
|||
if (caller == null || !caller.HasWriteAccess)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
db.CreateInstallation(installation);
|
||||
if (db.GetInstallationById(1)!.Name != installation.Name)
|
||||
{
|
||||
return new HttpResponseMessage(HttpStatusCode.BadRequest);
|
||||
}
|
||||
var id = db.CreateInstallation(installation);
|
||||
|
||||
return db.AddToAccessibleInstallations(caller.Id, 1);
|
||||
return db.AddToAccessibleInstallations(caller.Id, id);
|
||||
|
||||
}
|
||||
|
||||
|
@ -269,11 +265,11 @@ public class Controller
|
|||
{
|
||||
var caller = GetCaller();
|
||||
using var db = Db.Connect();
|
||||
if (caller == null || !caller.HasWriteAccess || db.GetInstallationByName(folder.Name) != null)
|
||||
if (caller == null || !caller.HasWriteAccess)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
db.CreateFolder(folder);
|
||||
return db.AddToAccessibleInstallations(caller.Id, db.GetInstallationByName(folder.Name)!.Id);
|
||||
var id = db.CreateFolder(folder);
|
||||
return db.AddToAccessibleFolders(caller.Id, id);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue