EPrints Technical Mailing List Archive
Message: #00005
< 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
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Can't hide histories from simple users only
- From: Florian Heß <hess@ub.uni-heidelberg.de>
- Date: Thu, 23 Feb 2012 16:45:33 +0100
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/
- Follow-Ups:
- [EP-tech] Re: Can't hide histories from simple users only
- From: Tim Brody <tdb2@ecs.soton.ac.uk>
- [EP-tech] Re: Can't hide histories from simple users only
- Prev by Date: [EP-tech] Searches returning incorrect results
- Next by Date: [EP-tech] EPrints for Windows?
- Previous by thread: [EP-tech] Searches returning incorrect results
- Next by thread: [EP-tech] Re: Can't hide histories from simple users only
- Index(es):