Fix a bug in the wildcard permission evaluating code, and refactor a bit for consistency.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>