diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index bafad525638..83cf6b52fce 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -487,9 +487,12 @@ mobile_apis::Result::eType CommandRequestImpl::GetMobileResultCode( bool CommandRequestImpl::CheckAllowedParameters() { LOG4CXX_AUTO_TRACE(logger_); - // RegisterAppInterface should always be allowed - if (mobile_apis::FunctionID::RegisterAppInterfaceID == - static_cast(function_id())) { + // RegisterAppInterface and UnregisterAppInterface should always be allowed + using namespace helpers; + if (Compare( + static_cast(function_id()), + mobile_apis::FunctionID::RegisterAppInterfaceID, + mobile_apis::FunctionID::UnregisterAppInterfaceID)) { return true; } diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc index 2471ec1165e..67d2b3d5581 100644 --- a/src/components/application_manager/test/commands/command_request_impl_test.cc +++ b/src/components/application_manager/test/commands/command_request_impl_test.cc @@ -515,6 +515,26 @@ TEST_F(CommandRequestImplTest, (*result)[strings::msg_params][strings::info].asString().empty()); } +TEST_F(CommandRequestImplTest, CheckPermissions_UnregisterAppInterface_True) { + MessageSharedPtr msg = CreateMessage(); + (*msg)[strings::params][strings::function_id] = + mobile_apis::FunctionID::UnregisterAppInterfaceID; + + CommandPtr command = CreateCommand(msg); + + EXPECT_TRUE(command->CheckPermissions()); +} + +TEST_F(CommandRequestImplTest, CheckPermissions_RegisterAppInterface_True) { + MessageSharedPtr msg = CreateMessage(); + (*msg)[strings::params][strings::function_id] = + mobile_apis::FunctionID::RegisterAppInterfaceID; + + CommandPtr command = CreateCommand(msg); + + EXPECT_TRUE(command->CheckPermissions()); +} + } // namespace command_request_impl } // namespace commands_test } // namespace components