mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-03 04:07:45 +00:00
Adding creation right ans support for owner field in user.
This commit is contained in:
@@ -58,12 +58,10 @@ namespace OpenWifi {
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AuthService()->DeleteSubUserFromCache(Id)) {
|
AuthService()->DeleteSubUserFromCache(Id);
|
||||||
// nothing to do
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger_.information(Poco::format("Remove all tokens for '%s'", UserInfo_.userinfo.email));
|
|
||||||
StorageService()->SubTokenDB().RevokeAllTokens(TargetUser.email);
|
StorageService()->SubTokenDB().RevokeAllTokens(TargetUser.email);
|
||||||
|
StorageService()->PreferencesDB().DeleteRecord("id",Id);
|
||||||
|
|
||||||
Logger_.information(Poco::format("User '%s' deleted by '%s'.",Id,UserInfo_.userinfo.email));
|
Logger_.information(Poco::format("User '%s' deleted by '%s'.",Id,UserInfo_.userinfo.email));
|
||||||
OK();
|
OK();
|
||||||
}
|
}
|
||||||
@@ -221,13 +219,13 @@ namespace OpenWifi {
|
|||||||
|
|
||||||
if(!NewUser.userTypeProprietaryInfo.mfa.method.empty()) {
|
if(!NewUser.userTypeProprietaryInfo.mfa.method.empty()) {
|
||||||
if(NewUser.userTypeProprietaryInfo.mfa.method!="email" && NewUser.userTypeProprietaryInfo.mfa.method!="sms" ) {
|
if(NewUser.userTypeProprietaryInfo.mfa.method!="email" && NewUser.userTypeProprietaryInfo.mfa.method!="sms" ) {
|
||||||
return BadRequest("Unknown MFA method");
|
return BadRequest(RESTAPI::Errors::BadMFAMethod);
|
||||||
}
|
}
|
||||||
Existing.userTypeProprietaryInfo.mfa.method=NewUser.userTypeProprietaryInfo.mfa.method;
|
Existing.userTypeProprietaryInfo.mfa.method=NewUser.userTypeProprietaryInfo.mfa.method;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Existing.userTypeProprietaryInfo.mfa.enabled && Existing.userTypeProprietaryInfo.mfa.method.empty()) {
|
if(Existing.userTypeProprietaryInfo.mfa.enabled && Existing.userTypeProprietaryInfo.mfa.method.empty()) {
|
||||||
return BadRequest("Illegal MFA method");
|
return BadRequest(RESTAPI::Errors::BadMFAMethod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!ACLProcessor::Can(UserInfo_.userinfo,NewUser,ACLProcessor::CREATE)) {
|
if(!ACLProcessor::Can(UserInfo_.userinfo,NewUser,ACLProcessor::CREATE)) {
|
||||||
return UnAuthorized("Insufficient access rights.", ACCESS_DENIED);
|
return UnAuthorized(RESTAPI::Errors::InsufficientAccessRights, ACCESS_DENIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
Poco::toLowerInPlace(NewUser.email);
|
Poco::toLowerInPlace(NewUser.email);
|
||||||
@@ -225,13 +225,14 @@ namespace OpenWifi {
|
|||||||
|
|
||||||
if(!NewUser.userTypeProprietaryInfo.mfa.method.empty()) {
|
if(!NewUser.userTypeProprietaryInfo.mfa.method.empty()) {
|
||||||
if(NewUser.userTypeProprietaryInfo.mfa.method!="email" && NewUser.userTypeProprietaryInfo.mfa.method!="sms" ) {
|
if(NewUser.userTypeProprietaryInfo.mfa.method!="email" && NewUser.userTypeProprietaryInfo.mfa.method!="sms" ) {
|
||||||
return BadRequest("Unknown MFA method");
|
return BadRequest(RESTAPI::Errors::BadMFAMethod);
|
||||||
|
|
||||||
}
|
}
|
||||||
Existing.userTypeProprietaryInfo.mfa.method=NewUser.userTypeProprietaryInfo.mfa.method;
|
Existing.userTypeProprietaryInfo.mfa.method=NewUser.userTypeProprietaryInfo.mfa.method;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Existing.userTypeProprietaryInfo.mfa.enabled && Existing.userTypeProprietaryInfo.mfa.method.empty()) {
|
if(Existing.userTypeProprietaryInfo.mfa.enabled && Existing.userTypeProprietaryInfo.mfa.method.empty()) {
|
||||||
return BadRequest("Illegal MFA method");
|
return BadRequest(RESTAPI::Errors::BadMFAMethod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user