Please checkout this article on checking permissions.