[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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/