Improve performance on permission check