Added validation for API policies.

Review Request #6164 — Created July 29, 2014 and submitted — Latest diff uploaded

Information

Review Board
master
a53f02f...

Reviewers

This introduces WebAPIToken.validate_policy, which will look through a
policy definition and try to find any errors. It will check for required
data, data in invalid formats, policy IDs validity, and more.

This is called when posting or updating a policy, and the error will be
returned in the API error.

Unit tests pass.

Tested several bits of validation manually with my policy editor change.