Create a decorator to do global permission check.