Merge pull request #15 from gary-pei/master

Move permission code and update documentation