mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-01 19:27:59 +00:00
WiFi 5617 and ACL Error
This commit is contained in:
@@ -24,7 +24,7 @@ namespace OpenWifi {
|
||||
if(User.userRole==SecurityObjects::ROOT)
|
||||
return true;
|
||||
|
||||
if((User.userRole!=SecurityObjects::ADMIN || Target.userRole!=SecurityObjects::ROOT) && Op!=READ)
|
||||
if((User.userRole!=SecurityObjects::ADMIN && Target.userRole!=SecurityObjects::ROOT) && Op!=READ)
|
||||
return false;
|
||||
|
||||
if(User.userRole==SecurityObjects::ADMIN && Target.userRole==SecurityObjects::ROOT && Op!=READ)
|
||||
|
||||
@@ -10,6 +10,13 @@
|
||||
#include "ACLProcessor.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
|
||||
static void FilterCredentials(SecurityObjects::UserInfo & U) {
|
||||
U.currentPassword.clear();
|
||||
U.lastPasswords.clear();
|
||||
U.oauthType.clear();
|
||||
}
|
||||
|
||||
void RESTAPI_user_handler::DoGet() {
|
||||
std::string Id = GetBinding("id", "");
|
||||
if(Id.empty()) {
|
||||
@@ -28,9 +35,7 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
Poco::JSON::Object UserInfoObject;
|
||||
UInfo.currentPassword.clear();
|
||||
UInfo.lastPasswords.clear();
|
||||
UInfo.oauthType.clear();
|
||||
FilterCredentials(UInfo);
|
||||
UInfo.to_json(UserInfoObject);
|
||||
ReturnObject(UserInfoObject);
|
||||
}
|
||||
@@ -114,10 +119,9 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
Poco::JSON::Object UserInfoObject;
|
||||
FilterCredentials(UInfo);
|
||||
UInfo.to_json(UserInfoObject);
|
||||
|
||||
ReturnObject(UserInfoObject);
|
||||
|
||||
Logger_.information(Poco::format("User '%s' has been added by '%s')",UInfo.email, UserInfo_.userinfo.email));
|
||||
}
|
||||
|
||||
@@ -228,6 +232,7 @@ namespace OpenWifi {
|
||||
SecurityObjects::UserInfo NewUserInfo;
|
||||
StorageService()->GetUserByEmail(UserInfo_.userinfo.email,NewUserInfo);
|
||||
Poco::JSON::Object ModifiedObject;
|
||||
FilterCredentials(NewUserInfo);
|
||||
NewUserInfo.to_json(ModifiedObject);
|
||||
return ReturnObject(ModifiedObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user