Earlier, we wrote about the preamble, using which you can change the file name of a document by which it is catalogued. We’d mentioned that the document preamble is intended for more controls on the document being available in a versioned manner. In this post, we introduce how you can control who can view/edit your document.
To recap, the preamble is a section of your document demarcated by dotted lines (sequence of hyphens) like shown below -
-----------
.. preamble content ..
-----------
.. document body ..
Normally, a document you create is viewable by anyone who you send the link to, whether or not they are signed in to Patantara. This is to enable simple sharing. In some circumstances, you want tighter control over who can view or edit your document, even if they have the link. This can happen, for example, if you’re sharing a custom lesson to a few select students and don’t want the material to propagate further to others. Or you may have a collaborator who you wish to give edit permissions, but there are others to whom you only want to give viewing permissions.
You can now do all this within your document preamble. Here is how.
Giving viewing permissions
In the preamble, you can give a list of viewers
to whom the document
will be limited. Others (except you the owner) won’t be able to view
the document even if they have the document link. For example -
---------
viewers = harry@potter.org
snape@hogwarts.org
dumbledore@hogwarts.org
---------
... document body ...
Given such a list of viewers
in the preamble, Patantara will check
whether one of them is the current logged in user before giving
permission to them to view the document.
Giving editing permissions
In addition to specifying viewers, you can give edit permissions
to a different set of folks - your collaborators - using the
editors
list.
---------
viewers = harry@potter.org, ron@weasleys.org
editors = dumbledore@hogwarts.org, snape@hogwarts.org
---------
For obvious reasons, editors have all the permissions of viewers, in addition to permissions to edit a document and add audio content to it. Editors can also “copy” your document on Patantara to work on their own variants.
Format flexibility
The format of specifying the list of viewers
and editors
is quite flexible. You
can give it in any of the following ways (only showing the preamble) -
Comma separated list
---------
viewers = harry@potter.org, snape@hogwarts.org, dumbledore@hogwarts.org
---------
Space separated list
---------
editors = snape@hogwarts.org dumbledore@hogwarts.org
---------
Line separated list
---------
viewers = harry@potter.org
snape@hogwarts.org
dumbledore@hogwarts.org
---------
Multiple specifications
---------
viewers = harry@potter.org
viewers = snape@hogwarts.org
viewers = dumbledore@hogwarts.org
---------
Any combination of the above
---------
viewers = harry@potter.org
viewers = snape@hogwarts.org, ron@weasleys.org
dumbledore@hogwarts.org
---------