Added annotations for permission checking.
Refactored permission services to make them more general, and added annotations for handling permission checking.