Extract application permissions from a drools file and into Java code.

This is in preparation for the move to CDI.
Testing of this pull request must ensure that the same level of permissions in the drools file is still maintained. The drools file is still kept for reference. It may be removed after this pull request is QA'd and merged.
Unfortunately the code is asking for both at different points. I just saw that both were asking the same thing so decided to join them in a single method. I can replace all invocations of one for the other, and then remove the replaced one from the action list if we want to tackle that problem here as well.