ANN: RDF::ACL - access control lists for the semantic web

Toby Inkster mail at tobyinkster.co.uk
Tue Jan 26 15:41:02 CET 2010


http://search.cpan.org/dist/RDF-ACL/
(Uploaded 15 minutes ago, but may take a while to appear.)

The RDF::ACL Perl module implements access control lists using the ACL
vocab <http://www.w3.org/ns/auth/acl>. It works quite nicely with my
FOAF+SSL module; something like this...

### First you load up your access control list:

my $acl = RDF::ACL->new('acl.turtle');
# Or even... $acl = RDF::ACL->new('http://example.com/sparql');

### Then you need to authenticate your user.
### Using FOAF+SSL is a sensible method:

my $webid = 'http://example.net/anon#me'; # default
my $authentication = CGI::Auth::FOAF_SSL->new_from_cgi( CGI->new );
if ($authentication->is_secure)
{
  $webid = $authentication->agent->identity;
}

### Then, let's assume they're trying to access
### <https://example.com/private/document>

my $document   = 'https://example.com/private/document';

if ( $acl->check($webid,$document,'read') )
{
  # output document
}
else
{
  # output error message
}

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>


More information about the Dev mailing list