Database Reference
In-Depth Information
the relevant security settings are the last three characters of the permissions: r-x . This
means anybody can list and open the collection, but not write to it. Let's change this
so we can at least write to the collection and create our logfile.
Use the collection browser or the Java Admin Client to set the permissions to crwxr-
xrwx —that is, set the Write permission for Other. Figure 3-8 shows how this looks in
the collection browser.
Figure 3-8. Changing the permissions of the log collection
After that, log out and close your browser (to stop being admin ), open it again, and
revisit the plays-home.xq page. This should now run smoothly. Look inside the log
collection, and there it is: our exist101-log.xml document. It contains something like:
<eXist101-Log>
<LogEntry timestamp= "2013-04-09T20:51:27.205+02:00" > Visited plays-home
</LogEntry>
</eXist101-Log>
And yes, every time you revisit the plays-home.xq page, a new LogEntry element is
added. I'll leave it up to you to add the logging code to the other pages of our small
but beautiful application.
The x permission on a collection means something different than
the x permission on a resource. For a resource it means execute
rights, and this is important for XQuery scripts. Try this out by, for
instance, revoking the x permissions on our plays-home.xq file.
You should now get a security warning when you try to run it.
 
Search WWH ::




Custom Search