Last active
July 6, 2016 01:55
-
-
Save n8felton/ab5f0e7d9fbf82931a2f9cdad08432ab to your computer and use it in GitHub Desktop.
Change system.preferences.printing authorization policy right to allow `staff` group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Read the current policy and save to a plist | |
| /usr/bin/security \ | |
| authorizationdb \ | |
| read \ | |
| system.preferences.printing > "${TMPDIR}/system.preferences.printing.plist" | |
| # Show the current policy saved to the plist | |
| cat "${TMPDIR}/system.preferences.printing.plist" \ | |
| | plutil -convert xml1 -o - - | |
| # Change the policy so that the group is now "staff" | |
| defaults \ | |
| write \ | |
| "${TMPDIR}/system.preferences.printing.plist" \ | |
| group -string "staff" | |
| # Verify the group change is in the plist | |
| cat "${TMPDIR}/system.preferences.printing.plist" \ | |
| | plutil -convert xml1 -o - - | |
| # Set the policy using the modified plist | |
| sudo /usr/bin/security \ | |
| authorizationdb \ | |
| write \ | |
| system.preferences.printing < "${TMPDIR}/system.preferences.printing.plist" | |
| # Verify the change was imported properly | |
| /usr/bin/security \ | |
| authorizationdb \ | |
| read \ | |
| system.preferences.printing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment