[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: hess at ub.uni-heidelberg.de (Florian Heß)
- Date: Thu, 23 Feb 2012 16:45:33 +0100
- In-reply-to: <EMEW3|c5494ac62832697b37670dc85d54bda3o1JDUo14eprints-tech-bounces|ecs.soton.ac.uk|1329744560.4468.10133.camel@chassis.ecs.soton.ac.uk>
- 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>
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? :-)
Regards,
FH
>> (undef, undef, $hist) = @_;
>> $hist->stored_file( "dataobj.xml" )->remove;
>> $hist->EPrints::DataObj::remove();
>> });
>>
>> /Tim.
>>
>> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>> *** Archive: http://www.eprints.org/tech.php/
>> *** EPrints community wiki: http://wiki.eprints.org/
>
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
--
UB Heidelberg (Altstadt)
Pl?ck 107-109, 69117 HD
- Informationstechnik
- WWW-Redaktion
Tel. 06221 / 54 3550
http://www.ub.uni-heidelberg.de/