mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 02:58:00 +00:00
Adding default subscriber entity.
This commit is contained in:
@@ -41,6 +41,10 @@ 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);
|
||||
@@ -69,6 +73,14 @@ 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user