Allowing signup in the default entity.

This commit is contained in:
stephb9959
2022-04-06 09:21:38 -07:00
parent 53b1434900
commit ce5250598c
18 changed files with 252 additions and 96 deletions

View File

@@ -41,10 +41,6 @@ namespace OpenWifi{
return BadRequest(RESTAPI::Errors::CannotDeleteRoot);
}
if(Existing.type=="subscriber" && Existing.defaultEntity) {
return BadRequest(RESTAPI::Errors::CannotDeleteSubEntity);
}
if( !Existing.children.empty() || !Existing.devices.empty() || !Existing.venues.empty() || !Existing.locations.empty()
|| !Existing.contacts.empty() || !Existing.configurations.empty()) {
return BadRequest(RESTAPI::Errors::StillInUse);
@@ -54,7 +50,6 @@ namespace OpenWifi{
DB_.DeleteRecord("id",UUID);
DB_.DeleteChild("id",Existing.parent,UUID);
return OK();
}
void RESTAPI_entity_handler::DoPost() {
@@ -73,14 +68,6 @@ namespace OpenWifi{
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
}
if(NewEntity.type.empty()) {
NewEntity.type = "normal";
}
if(!ValidEntityType(NewEntity.type)) {
return BadRequest(RESTAPI::Errors::InvalidEntityType);
}
if(!ProvObjects::CreateObjectInfo(Obj,UserInfo_.userinfo,NewEntity.info)) {
return BadRequest(RESTAPI::Errors::NameMustBeSet);
}