Add getting required-privileges at GetAction
authorSangyoon Jang <jeremy.jang@samsung.com>
Mon, 21 Apr 2025 00:49:52 +0000 (09:49 +0900)
committer장상윤/Tizen Platform Lab(SR)/삼성전자 <jeremy.jang@samsung.com>
Mon, 21 Apr 2025 01:16:58 +0000 (10:16 +0900)
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/action/action_request_handler.cc
src/common/action_model.cc

index b3b612dcb7815aba5a49f6b63ea7b0d49d181e49..fdb822fbb0455bcbee99435dec19491c05223b78 100755 (executable)
@@ -111,13 +111,7 @@ rpc::Action ActionRequestHandler::OnGetAction(const std::string& id) {
     actionparams.push_back(param);
   }
   action.Setparameters(actionparams);
-
-  // action.Seturi();
-  // action.Setmime();
-  // action.Setoperation();
-  // action.Setparameters();
-  // action.Setresults();
-  // action.Setprivileges();
+  action.Setprivileges(model.GetPrivileges());
 
   return action;
 }
index e50c71e87faeb59aeba49076d2f51522e89aa0ca..01aace51029ddd7ba4ef37277c2b321e7642f3ff 100644 (file)
@@ -97,6 +97,9 @@ ActionModel::ActionModel(const std::string& json_str) {
       // ActionParameterType -> another class???
       returns_.emplace_back(name, type, "", description, false);
     }
+
+    for (auto const& it : root["required-privileges"])
+      privileges_.push_back(it.asString());
   } catch (const Json::Exception& e) {
     // TODO: how to handle invalid json case?
     LOG(ERROR) << "Failed to parse json string: " << e.what();