Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show DBP for US users #1792

Merged
merged 2 commits into from
Oct 31, 2023
Merged

Only show DBP for US users #1792

merged 2 commits into from
Oct 31, 2023

Conversation

SlayterDev
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/72649045549333/1205660000891177/f
Tech Design URL: https://app.asana.com/0/1204586965688315/1205744067595006/f
CC:

Description:
This PR gates DBP for US users only

Steps to test this PR:

  1. Make sure your locale is set to the US. "Private Information Removal" should show in the more menu
  2. Set your locale to another country (or flip the == to !=). "Private Information Removal" should not show in the more menu

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

}

// Only show Private Information Removal (DBP) for US based users
if (regionCode ?? "US") == "US" {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a chance (using both methods to acquire the locale) that a user's region code could be nil. In this case I've elected to show the feature as we've discussed the risk of non-US users accessing the feature is minimal. I'm open to other suggestions though.

Copy link
Collaborator

@Bunn Bunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. For the dev situation we could do something like this:

#if DBP
        var shouldShowDBPMenuItem = false

#if DEBUG
        shouldShowDBPMenuItem = true
#else

        var regionCode: String?
        if #available(macOS 13, *) {
            regionCode = Locale.current.region?.identifier
        } else {
            regionCode = Locale.current.regionCode
        }
        shouldShowDBPMenuItem = regionCode ?? "US" == "US"
#endif
....

@SlayterDev SlayterDev merged commit 08ba8c9 into develop Oct 31, 2023
16 checks passed
@SlayterDev SlayterDev deleted the brad/gate-dbp-users branch October 31, 2023 17:31
diegoreymendez pushed a commit that referenced this pull request Nov 1, 2023
Task/Issue URL:
https://app.asana.com/0/72649045549333/1205660000891177/f
Tech Design URL:
https://app.asana.com/0/1204586965688315/1205744067595006/f
CC:

**Description**:
This PR gates DBP for US users only

**Steps to test this PR**:
1. Make sure your locale is set to the US. "Private Information Removal"
should show in the more menu
2. Set your locale to another country (or flip the `==` to `!=`).
"Private Information Removal" should *not* show in the more menu

<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be
marked with the `DO NOT MERGE` label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the `Pending Product
Review` label.

If at any point it isn't actively being worked on/ready for
review/otherwise moving forward (besides the above PR/PFR exception)
strongly consider closing it (or not opening it in the first place). If
you decide not to close it, make sure it's labelled to make it clear the
PRs state and comment with more information.
-->

---
###### Internal references:
[Pull Request Review
Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f)
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
[Pull Request
Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants