mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-02 03:37:51 +00:00
Allow SUBSCRIBER to delete herself.
This commit is contained in:
@@ -57,20 +57,26 @@ namespace OpenWifi {
|
|||||||
Poco::Net::HTTPRequestHandler * RESTAPI_IntRouter(const char *Path, RESTAPIHandler::BindingMap &Bindings,
|
Poco::Net::HTTPRequestHandler * RESTAPI_IntRouter(const char *Path, RESTAPIHandler::BindingMap &Bindings,
|
||||||
Poco::Logger & L, RESTAPI_GenericServer & S, uint64_t TransactionId) {
|
Poco::Logger & L, RESTAPI_GenericServer & S, uint64_t TransactionId) {
|
||||||
return RESTAPI_Router_I<
|
return RESTAPI_Router_I<
|
||||||
RESTAPI_users_handler,
|
RESTAPI_oauth2_handler,
|
||||||
RESTAPI_user_handler,
|
RESTAPI_users_handler,
|
||||||
RESTAPI_subuser_handler,
|
RESTAPI_user_handler,
|
||||||
RESTAPI_subusers_handler,
|
RESTAPI_system_command,
|
||||||
RESTAPI_system_command,
|
RESTAPI_asset_server,
|
||||||
RESTAPI_action_links,
|
RESTAPI_system_endpoints_handler,
|
||||||
RESTAPI_validate_token_handler,
|
RESTAPI_action_links,
|
||||||
RESTAPI_validate_sub_token_handler,
|
RESTAPI_avatar_handler,
|
||||||
RESTAPI_sms_handler,
|
RESTAPI_subavatar_handler,
|
||||||
RESTAPI_preferences,
|
RESTAPI_email_handler,
|
||||||
RESTAPI_subpreferences,
|
RESTAPI_sms_handler,
|
||||||
RESTAPI_suboauth2_handler,
|
RESTAPI_preferences,
|
||||||
RESTAPI_submfa_handler,
|
RESTAPI_subpreferences,
|
||||||
RESTAPI_signup_handler
|
RESTAPI_suboauth2_handler,
|
||||||
|
RESTAPI_subuser_handler,
|
||||||
|
RESTAPI_subusers_handler,
|
||||||
|
RESTAPI_submfa_handler,
|
||||||
|
RESTAPI_totp_handler,
|
||||||
|
RESTAPI_subtotp_handler,
|
||||||
|
RESTAPI_signup_handler
|
||||||
>(Path, Bindings, L, S, TransactionId);
|
>(Path, Bindings, L, S, TransactionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,11 +38,14 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RESTAPI_subuser_handler::DoDelete() {
|
void RESTAPI_subuser_handler::DoDelete() {
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
std::string Id = GetBinding("id", "");
|
std::string Id = GetBinding("id", "");
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
if(Id.empty()) {
|
if(Id.empty()) {
|
||||||
return BadRequest(RESTAPI::Errors::MissingUserID);
|
return BadRequest(RESTAPI::Errors::MissingUserID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
SecurityObjects::UserInfo TargetUser;
|
SecurityObjects::UserInfo TargetUser;
|
||||||
if(!StorageService()->SubDB().GetUserById(Id,TargetUser)) {
|
if(!StorageService()->SubDB().GetUserById(Id,TargetUser)) {
|
||||||
return NotFound();
|
return NotFound();
|
||||||
|
|||||||
Reference in New Issue
Block a user