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)
|
if (caller == null || !caller.HasWriteAccess)
|
||||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||||
|
|
||||||
db.CreateInstallation(installation);
|
var id = db.CreateInstallation(installation);
|
||||||
if (db.GetInstallationById(1)!.Name != installation.Name)
|
|
||||||
{
|
|
||||||
return new HttpResponseMessage(HttpStatusCode.BadRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
return db.AddToAccessibleInstallations(caller.Id, 1);
|
return db.AddToAccessibleInstallations(caller.Id, id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,11 +265,11 @@ public class Controller
|
||||||
{
|
{
|
||||||
var caller = GetCaller();
|
var caller = GetCaller();
|
||||||
using var db = Db.Connect();
|
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);
|
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||||
|
|
||||||
db.CreateFolder(folder);
|
var id = db.CreateFolder(folder);
|
||||||
return db.AddToAccessibleInstallations(caller.Id, db.GetInstallationByName(folder.Name)!.Id);
|
return db.AddToAccessibleFolders(caller.Id, id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue