Added validators for package and package group rules

Also contains some refactored code and fixes for publish.
Allowing assert_authorized to take an array of permissions
Merge pull request #2017 from parthaa/package-rules-part-deux

Added validators for package and package group rules
Merge pull request #2067 from daviddavis/temp_1366835072

Allowing assert_authorized to take an array of permissions