#! /usr/bin/perl -T
use strict;
use warnings;
use utf8;

use lib '../include';
use itkaclcommon;

itkaclcommon::init();

my $entry = $itkaclcommon::cgi->param('entry');
my $entity = $itkaclcommon::cgi->param('entity');
my $entity_type = $itkaclcommon::cgi->param('entity_type');

$itkaclcommon::dbh->do('DELETE FROM aclentries WHERE object=? AND entity_type=? AND entity=?', undef,
    $entry, $entity_type, $entity)
	or die "Couldn't do deletion";

# Let sync-itkacl know there's updates
utime(time(), time(), '/etc/itkacl/updated');

print $itkaclcommon::cgi->redirect("view.pl?entry=$entry");

