Added logic to specify what permissions are user gets when they create a document, and actually grant those permissions when document is created