[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[EP-tech] Re: Can't hide histories from simple users only
- Subject: [EP-tech] Re: Can't hide histories from simple users only
- From: tdb2 at ecs.soton.ac.uk (Tim Brody)
- Date: Fri, 24 Feb 2012 13:56:55 +0000
- In-reply-to: <4F465F1D.401@ub.uni-heidelberg.de>
- References: <4F2BC5F9.4010009@ub.uni-heidelberg.de> <1329498370.4468.2187.camel@chassis.ecs.soton.ac.uk> <EMEW3|0752cf10f6977c0147b1abe577cf7317o1GH6D04tdb2|ecs.soton.ac.uk|1329498370.4468.2187.camel@chassis.ecs.soton.ac.uk> <4F421E10.3080805@ub.uni-heidelberg.de> <EMEW3|dae558dad7cc3afcc78cd13da253b8c6o1JALO14eprints-tech-bounces|ecs.soton.ac.uk|4F421E10.3080805@ub.uni-heidelberg.de> <4F423CFE.2090709@ub.uni-heidelberg.de> <1329743284.4468.10111.camel@chassis.ecs.soton.ac.uk> <1329744560.4468.10133.camel@chassis.ecs.soton.ac.uk> <EMEW3|c5494ac62832697b37670dc85d54bda3o1JDUo14eprints-tech-bounces|ecs.soton.ac.uk|1329744560.4468.10133.camel@chassis.ecs.soton.ac.uk> <4F465F1D.401@ub.uni-heidelberg.de>
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.