Hi Theodoros:
On Wed, 02 Apr 2008, Theodoropoulos Theodoros wrote:
> In the meantime, I got very curious when i realised that the
> fulltext in demo record#1 is restricted, although the collection in
> it's entirety is not! HOW DO YOU DO THAT? As i can see it has
> nothing to do with webaccess and although the demobibdata.xml has a
> subfield r'=restrdoc for the file to be transfered, the final marc
> representation for record#1 has no indication that there is a
> restriction for anonymous users.
It is done through the WebAccess's new firewall like role definition
language, so the restriction is not kept in MARCXML. An explanation
is provided by the BibUpload Admin Guide on FFT $r:
The $r subfield can contain a keyword that can be use to restrict
the given document. The same keyword must be specified for all the
format of a given document. The keyword will be used as the status
parameter for the "viewrestrdoc" action, which can be used to give
access right/restriction to desired user. e.g. if you set the
keyword "thesis", you can the connect the "thesisviewer" to the
action "viewrestrdoc" with parameter "status" set to "thesis". Then
all the user which are linked with the "thesisviewer" role will be
able to download the document. Instead any other user will not be
allowed. Note, if you use the keyword "KEEP-OLD-VALUE" the previous
restrictions if applicable will be kept.
The demo site configuration then grant rights to the 'thesisviewer'
role on the action 'viewrestrdoc' with the keyword status value
'restrdoc':
$ grep -r restrdoc ./webaccess/lib/access_control_config.py
('viewrestrdoc', 'view restricted document', 'status', 'no'),
('thesesviewer', 'viewrestrdoc', -1, 0, {'status': 'restrdoc'}),
It is indeed quite misleading to reuse the thesisviewer role in order
to demo the restricted icon functionality. I think we'd better
introduce a new 'restricted_picture' and 'restricted_picture_viewer'
examples for the demo site, as well as to clarify the keyword/status
wording in the documentation... (CC-ing the gang). But I hope you can
see now how it's done.
> We are VERY interested in this feature, as we have users that have
> requested the fulltext of their theses to be released in ie. one or
> two years after the thesis submission. I was wondering if i could
> write a 'script' that would be run every night and 'change' a
> restriction' subfield in the marc representation (If the restriction
> is applied in this way), allowing the view of the fulltext if the
> release date has arrived.
Yes, I remember this use case of yours. We were thinking of
potentially introducing opening-closing dates with bibdoc files in a
native way, as this may be a generally useful feature.
Indeed, you can now write MARCXML snippets with FFT $r in order to
change the restriction of a file according to your needs at a given
time. Moreover, CDS Invenio v0.99.1 will provide a new 'bibdocfile'
CLI tool that will allow you to change the restriction status even
more easily from within CLI:
$ /opt/cds-invenio/bin/bibdocfile --recid 1234 \
--restriction hidden-thesis
without having to write and submit those MARCXML FFT snippets. So you
could possibly put such bibdocfile calls into a crontab or something.
Best regards
--
Tibor Simko ** CERN Document Server ** <http://cds.cern.ch/>