EPrints Technical Mailing List Archive

Message: #00009


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Can't hide histories from simple users only


On Thu, 2012-02-23 at 16:45 +0100, Florian Heß wrote:
> Am 20.02.2012 14:29, schrieb Tim Brody:
> > On Mon, 2012-02-20 at 13:08 +0000, Tim Brody wrote:
> >> On Mon, 2012-02-20 at 13:30 +0100, Florian Heß wrote:
> >>> Am 20.02.2012 11:18, schrieb Florian Heß:
> >>>
> >>>> Isn't there a shorter way to hide user or eprint history for everyone
> >>>> except for the admin?
> >>>>
> >>>
> >>> Sorry, that isn't the requirement, I was wrong. We do indeed have to
> >>> disable history completely, _nothing of that kind must_ be saved on disk
> >>> and retrievable afterwards. Thus, can we disable not only the history
> >>> tabs but also the creation of the revisions? Otherwise, is it safe to
> >>> delete all revisions/ directories on a regular basis via cron?
> >>
> >> Would a nightly 'cron' that removes all history objects be ok?
> >>
> >> $repo->dataset( "history" )->map(sub {
> >
> > typo:
> > $repo->dataset( "history" )->search->map(sub {
> >
> 
> Hi Tim,
> 
> #!/usr/bin/perl
> # script to delete all history records and revisions
> use strict;
> 
> use FindBin;
> use lib "$FindBin::Bin/../perl_lib";
> 
> use EPrints;
> 
> my $repo = EPrints->new->repository($ARGV[0]);
> 
> $repo->dataset( "history" )->search( staff => 1 )->map(sub {
>      my (undef, undef, $hist) = @_;
>      if ( my $file_rec = $hist->stored_file( "dataobj.xml" ) ) {
>          print $file_rec->get_value("fileid"), " gelöscht.\n";
>          $file_rec->remove;
>      }
>      $hist->EPrints::DataObj::remove();
> });
> 
> After running it, the revisions are still there, e.g.
> archives/$REPOID/documents/disk0/00/00/00/88/revisions/6.xml
> 
> Running it again, no records to remove are found.
> 
> Hence, WHAT exactly has been deleted here? :-)

That removed revision files for me.

You may need to manually remove revision files if they have no
associated history object ...

/Tim.