[Application] Added permission getter/setters in applicaiton

Added session and persistent permission getter/setters. Also moved
permission policy manager into application system. Moved permission
initialization logic out of application data, i.e. the application
data won't initialize itself.

[Application] Add permission check logic in application

This method is used to check API Control. It queries permissions
 actions from policy storage and tell the result to extension.
Merge pull request #1571 from mbbill/permission_3

[Application] Added permission check logic and getter/setters in application classes.