omni::extras::PrivacySettings
Defined in omni/extras/PrivacySettings.h
-
class PrivacySettings
Static helper class to provide standardized access to the telemetry privacy setting values.
These settings provide information such as the active user ID and the consent permissions for the various event types. These settings are expected to already have been loaded into the settings registry (accessible through ISettings). This just provides simple access to the settings values but does not provide functionality for loading the settings in the first place or providing a wrapper for change subscriptions on those settings.
Loading the settings is left up to the
omni.structuredlog.plugin
module. This module will manage loading the settings when it initializes. It will also refresh the settings any time the original settings file for them changes. This file is located at$HOME_PATH/.nvidia-omniverse/config/privacy.toml
(where$HOME_PATH
is the user’s home directory on the local system).This helper class does not directly handle change subscriptions to the various privacy settings. This is done to avoid complication and potential issues during shutdown of global objects. It does however expose the paths of the various privacy settings so that external callers can subscribe for and manage their own change notifications.
Note
The methods in this helper class are just as thread safe as the ISettings interface itself is when retrieving a value. All methods are static so there is no state data that could be clobbered by multiple threads in this object itself.
Note
The Carbonite framework must be initialized before using this helper class. A crash will occur if the framework is not initialized first.
Public Static Functions
-
static inline const char *getVersion()
Retrieves the version setting found in the privacy config.
- Thread Safety
This call is thread safe.
- Returns
A string containing the version information value for the privacy settings file. This version gives an indication of what other values might be expected in the file.
-
static inline const char *getUserId()
Retrieves the user ID found in the privacy config.
- Thread Safety
This call is thread safe.
- Returns
A string containing the user ID that is currently logged into omniverse. This is the user ID that should be used when writing out any structured log events or sending crash reports. This does not necessarily reflect the user ID that will be used to login to a Nucleus server instance however.
- Returns
An empty string if no user ID setting is currently present.
-
static inline const char *getEmail()
Retrieves the user email address if specified in the privacy config.
- Thread Safety
This call is thread safe.
- Returns
A string containing the currently logged in user’s email address. This is only expected to be present for some users. This email address will not be emitted with any structured log events.
- Returns
An empty string if no user email address is currently present.
-
static inline const char *getIdpName()
Retrieves the identity provider’s name if specified in the privacy config.
- Thread Safety
This call is thread safe.
- Return values
A – string containing the name of the identity provider that was used to authenticate the current user. This name is optional.
An – empty string if no identity provider name is currently present.
-
static inline const char *getIdpId()
Retrieves the identity provider’s identifier if specified in the privacy config.
- Thread Safety
This call is thread safe.
- Return values
A – string containing the identifier of the identity provider that was used to authenticate the current user. This identifier is optional.
An – empty string if no identity provider identifier is currently present.
-
static inline bool getConsentLevel(ConsentLevel level)
Retrieves the consent state for a requested consent level.
- Thread Safety
This call is thread safe.
- Parameters
level – [in] The consent level to query.
- Returns
The current state of the requested consent level if present.
- Returns
false
if the state of the requested consent level could not be successfully queried.
-
static inline bool canSendExtraDiagnosticData()
Checks whether the user has opted into sending diagnostic data.
- Returns
true
if the user has opted into sending diagnostic data.- Returns
false
if the user has opted out of sending diagnostic data.
Public Static Attributes
-
static constexpr const char *kVersionKey = "/privacy/version"
The settings key path for the version of the privacy settings file.
-
static constexpr const char *kPerformanceKey = "/privacy/performance"
The settings key path for the ‘performance’ consent level.
-
static constexpr const char *kPersonalizationKey = "/privacy/personalization"
The settings key path for the ‘personalization’ consent level.
-
static constexpr const char *kUsageKey = "/privacy/usage"
The settings key path for the ‘usage’ consent level.
-
static constexpr const char *kUserIdKey = "/privacy/userId"
The settings key path for the current user ID name.
-
static constexpr const char *kEmailKey = "/privacy/email"
The settings key path for the current user’s email address.
This is not expected to be present for all users.
-
static constexpr const char *kExternalBuildKey = "/privacy/externalBuild"
The settings key path for the ‘external build’ flag.
-
static constexpr const char *kExtraDiagnosticDataOptInKey = "/privacy/extraDiagnosticDataOptIn"
The settings key path for the ‘send extra diagnostic data’ flag.
-
static constexpr const char *kIdpNameKey = "/privacy/idpName"
The settings key path for the identity provider’s name.
-
static constexpr const char *kIdpIdKey = "/privacy/idpId"
The settings key path for the identity provider’s identifier.
-
static constexpr const char *kSettingTree = "/privacy"
The settings key path for all of the privacy settings tree.
-
static inline const char *getVersion()