给passwd指令添加权限校验
This commit is contained in:
@ -171,7 +171,10 @@ std::vector<std::string> BookStoreEngineClass::ExecutePasswd(
|
|||||||
if (!CommandPasswdLexer(cmd, user_id, current_password, new_password))
|
if (!CommandPasswdLexer(cmd, user_id, current_password, new_password))
|
||||||
return std::vector<std::string>({"Invalid"});
|
return std::vector<std::string>({"Invalid"});
|
||||||
// debugPrint("sucessfully lexed passwd");
|
// debugPrint("sucessfully lexed passwd");
|
||||||
if (user_data_base.GetPrevilege(user_id) < 1)
|
if (user_data_base.GetPrevilege(user_id) == -1)
|
||||||
|
return std::vector<std::string>({"Invalid"});
|
||||||
|
if (login_stack.empty() ||
|
||||||
|
user_data_base.GetPrevilege(login_stack.top().first) < 1)
|
||||||
return std::vector<std::string>({"Invalid"});
|
return std::vector<std::string>({"Invalid"});
|
||||||
// debugPrint("begin checing authority");
|
// debugPrint("begin checing authority");
|
||||||
if (login_stack.size() > 0 &&
|
if (login_stack.size() > 0 &&
|
||||||
|
Reference in New Issue
Block a user