diff options
Diffstat (limited to 'src/components/policy/policy_external/include/policy/policy_manager_impl.h')
-rw-r--r-- | src/components/policy/policy_external/include/policy/policy_manager_impl.h | 140 |
1 files changed, 129 insertions, 11 deletions
diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index c7d9c8478f..2ee7edf472 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -119,9 +119,28 @@ class PolicyManagerImpl : public PolicyManager { void RequestPTUpdate() OVERRIDE; /** + * DEPRECATED + * @brief Check if specified RPC for specified application + * has permission to be executed in specified HMI Level + * and also its permitted params. + * @param app_id Id of application provided during registration + * @param hmi_level Current HMI Level of application + * @param rpc Name of RPC + * @param rpc_params List of RPC params + * @param result containing flag if HMI Level is allowed + * and list of allowed params. + */ + DEPRECATED void CheckPermissions(const PTString& app_id, + const PTString& hmi_level, + const PTString& rpc, + const RPCParams& rpc_params, + CheckPermissionResult& result) OVERRIDE; + + /** * @brief Check if specified RPC for specified application * has permission to be executed in specified HMI Level * and also its permitted params. + * @param device_id device identifier * @param app_id Id of application provided during registration * @param hmi_level Current HMI Level of application * @param rpc Name of RPC @@ -129,7 +148,8 @@ class PolicyManagerImpl : public PolicyManager { * @param result containing flag if HMI Level is allowed * and list of allowed params. */ - void CheckPermissions(const PTString& app_id, + void CheckPermissions(const PTString& device_id, + const PTString& app_id, const PTString& hmi_level, const PTString& rpc, const RPCParams& rpc_params, @@ -265,14 +285,28 @@ class PolicyManagerImpl : public PolicyManager { const bool is_allowed) OVERRIDE; /** + * DEPRECATED + * @brief Update Application Policies as reaction + * on User allowing/disallowing device this app is running on. + * @param app_id Unique application id + * @param is_device_allowed true if user allowing device otherwise false + * @return true if operation was successful + */ + DEPRECATED bool ReactOnUserDevConsentForApp( + const std::string& app_id, const bool is_device_allowed) OVERRIDE; + + /** * @brief Update Application Policies as reaction * on User allowing/disallowing device this app is running on. + * @param device_handle device identifier * @param app_id Unique application id * @param is_device_allowed true if user allowing device otherwise false * @return true if operation was successful */ - bool ReactOnUserDevConsentForApp(const std::string& app_id, - const bool is_device_allowed) OVERRIDE; + bool ReactOnUserDevConsentForApp( + const transport_manager::DeviceHandle& device_handle, + const std::string& app_id, + const bool is_device_allowed) OVERRIDE; /** * @brief Retrieves data from app_policies about app on its registration: @@ -314,13 +348,26 @@ class PolicyManagerImpl : public PolicyManager { const NotificationMode mode) OVERRIDE; /** + * DEPRECATED * @brief Get default HMI level for application * @param policy_app_id Unique application id * @param default_hmi Default HMI level for application or empty, if value * was not set * @return true, if succedeed, otherwise - false */ - bool GetDefaultHmi(const std::string& policy_app_id, + DEPRECATED bool GetDefaultHmi(const std::string& policy_app_id, + std::string* default_hmi) const OVERRIDE; + + /** + * @brief Get default HMI level for application + * @param device_id device identifier + * @param policy_app_id Unique application id + * @param default_hmi Default HMI level for application or empty, if value + * was not set + * @return true, if succedeed, otherwise - false + */ + bool GetDefaultHmi(const std::string& device_id, + const std::string& policy_app_id, std::string* default_hmi) const OVERRIDE; /** @@ -365,9 +412,11 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief Return device id, which hosts specific application + * @param device_id device identifier * @param policy_app_id Application id, which is required to update device id */ std::string& GetCurrentDeviceId( + const transport_manager::DeviceHandle& device_id, const std::string& policy_app_id) const OVERRIDE; /** @@ -407,13 +456,24 @@ class PolicyManagerImpl : public PolicyManager { void SetVINValue(const std::string& value) OVERRIDE; /** + * DEPRECATED * @brief Gets specific application permissions changes since last policy * table update * @param policy_app_id Unique application id * @return Permissions changes */ + DEPRECATED AppPermissions + GetAppPermissionsChanges(const std::string& policy_app_id) OVERRIDE; + + /** + * @brief Gets specific application permissions changes since last policy + * table update + * @param device_id device identifier + * @param policy_app_id Unique application id + * @return Permissions changes + */ AppPermissions GetAppPermissionsChanges( - const std::string& policy_app_id) OVERRIDE; + const std::string& device_id, const std::string& policy_app_id) OVERRIDE; /** * @brief Removes specific application permissions changes @@ -456,22 +516,48 @@ class PolicyManagerImpl : public PolicyManager { void MarkUnpairedDevice(const std::string& device_id) OVERRIDE; /** + * DEPRECATED + * @brief Adds, application to the db or update existed one + * run PTU if policy update is necessary for application. + * @param application_id Unique application id + * @param hmi_types application HMI types + * @return function that will notify update manager about new application + */ + DEPRECATED StatusNotifier AddApplication( + const std::string& application_id, + const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE; + + /** * @brief Adds, application to the db or update existed one * run PTU if policy update is necessary for application. + * @param device_id device identifier * @param application_id Unique application id * @param hmi_types application HMI types * @return function that will notify update manager about new application */ StatusNotifier AddApplication( + const std::string& device_id, const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE; /** + * DEPRECATED * @brief Assigns new HMI types for specified application * @param application_id Unique application id * @param hmi_types new HMI types list */ - void SetDefaultHmiTypes(const std::string& application_id, + DEPRECATED void SetDefaultHmiTypes( + const std::string& application_id, + const std::vector<int>& hmi_types) OVERRIDE; + + /** + * @brief Assigns new HMI types for specified application + * @param device_handle device identifier + * @param application_id Unique application id + * @param hmi_types new HMI types list + */ + void SetDefaultHmiTypes(const transport_manager::DeviceHandle& device_handle, + const std::string& application_id, const std::vector<int>& hmi_types) OVERRIDE; /** @@ -565,10 +651,12 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief Gets request types for application + * @param device_handle device identifier * @param policy_app_id Unique application id * @return request types of application */ const std::vector<std::string> GetAppRequestTypes( + const transport_manager::DeviceHandle& device_handle, const std::string policy_app_id) const OVERRIDE; /** @@ -854,6 +942,23 @@ class PolicyManagerImpl : public PolicyManager { private: /** * DEPRECATED + * @brief Gets request types for application + * @param policy_app_id Unique application id + * @return request types of application + */ + const std::vector<std::string> GetAppRequestTypes( + const std::string policy_app_id) const OVERRIDE; + + /** + * DEPRECATED + * @brief Return device id, which hosts specific application + * @param policy_app_id Application id, which is required to update device id + */ + std::string& GetCurrentDeviceId( + const std::string& policy_app_id) const OVERRIDE; + + /** + * DEPRECATED * @brief Send OnPermissionsUpdated for choosen application * @param application_id Unique application id */ @@ -941,19 +1046,23 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief Allows to process case when added application is not present in * policy db. + * @param device_id device identifier * @param policy application id. * @param cuuren consent for application's device. */ - void AddNewApplication(const std::string& application_id, + void AddNewApplication(const std::string& device_id, + const std::string& application_id, DeviceConsent device_consent); /** * @brief Allows to process case when added application is already * in policy db. + * @param device_id device identifier * @param policy application id. * @param cuuren consent for application's device. */ - void PromoteExistedApplication(const std::string& application_id, + void PromoteExistedApplication(const std::string& device_id, + const std::string& application_id, DeviceConsent device_consent); /** @@ -971,9 +1080,12 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief Checks whether need ask the permission of users + * @param device_id device identifier + * @param appid policy application id * @return true if user consent is needed */ - virtual bool IsConsentNeeded(const std::string& app_id); + virtual bool IsConsentNeeded(const std::string& device_id, + const std::string& app_id); /** * @brief Changes isConsentNeeded for app pending permissions, in case @@ -1090,11 +1202,13 @@ class PolicyManagerImpl : public PolicyManager { * user consents (if any) and ExternalConsent consents (if any) will be * updated * appropiately to current ExternalConsent status stored by policy table + * @param device_id device identifier * @param application_id Application id * @param processing_policy Defines whether consents timestamps must be * considered or external consents take over */ void ProcessExternalConsentStatusForApp( + const std::string& device_id, const std::string& application_id, const ConsentProcessingPolicy processing_policy); /** @@ -1122,16 +1236,20 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief Notifies system by sending OnAppPermissionChanged notification + * @param device_id device identifier * @param app_policy Reference to application policy */ - void NotifySystem(const AppPoliciesValueType& app_policy) const; + void NotifySystem(const std::string& device_id, + const AppPoliciesValueType& app_policy) const; /** * @brief Sends OnPermissionChange notification to application if its * currently registered + * @param device_id device identifier * @param app_policy Reference to application policy */ - void SendPermissionsToApp(const AppPoliciesValueType& app_policy); + void SendPermissionsToApp(const std::string& device_id, + const AppPoliciesValueType& app_policy); /** * @brief Gets groups names from collection of groups permissions |