Adding additional security for SMS: only root, partner, admin are allowed to send SMS.

This commit is contained in:
stephb9959
2022-01-10 07:11:13 -08:00
parent d38e4ca2fc
commit cf903a57ab

View File

@@ -33,6 +33,12 @@ namespace OpenWifi {
return BadRequest("Code and number could not be validated");
}
if( UserInfo_.userinfo.userRole!=SecurityObjects::ROOT &&
UserInfo_.userinfo.userRole!=SecurityObjects::PARTNER &&
UserInfo_.userinfo.userRole!=SecurityObjects::ADMIN) {
return UnAuthorized(RESTAPI::Errors::InsufficientAccessRights,ACCESS_DENIED);
}
if (Obj->has("to") &&
Obj->has("text")) {