Closed Bug 1498032 Opened 1 year ago Closed 1 year ago

Support flat policies on Mac OS

Categories

(Firefox :: Enterprise Policies, defect)

defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 64
Tracking Status
firefox64 --- verified

People

(Reporter: Felipe, Assigned: Felipe)

References

Details

Attachments

(2 files)

On bug 1445943 it was mentioned that some users would like a way to specify the policies in a flat format, since `defaults write` doesn't support creation of the nested structures that the .plist file supports.

I thought of a mixed approach that would support policies being specified both in the nested format, and also in a flat format. Policies that contains the string "__" on them will be unflattened before being passed back to the policy engine.


With this, one could do something like:

defaults write org.mozilla.nightly BlockAboutAddons -bool YES
defaults write org.mozilla.nightly Homepage__URL https://www.example.com
defaults write org.mozilla.nightly Homepage__Locked -bool YES

to represent the same as:
{
  BlockAboutAddons: true,
  Homepage: {
    URL: "https://www.example.com",
    Locked: true
  }
}
Stephen, take a look at this idea and feel free to provide feedback or review too
spohl should be marked to review these, not me.
Pushed by fgomes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/31eac8d65771
Part 0. Move the removeUnknownPolicies function into macOSPoliciesParser.jsm. r=spohl
https://hg.mozilla.org/integration/autoland/rev/c58e52e69803
Support flat policies on Mac. r=spohl
https://hg.mozilla.org/mozilla-central/rev/31eac8d65771
https://hg.mozilla.org/mozilla-central/rev/c58e52e69803
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
I have managed to verify this bug on Beta 64.0b12 using macOS 10.13. I can confirm that the policies from comment 0 are correctly applied.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.