[foaf-protocols] ANN: RDF::ACL - access control lists for the semantic web
Melvin Carvalho
melvincarvalho at gmail.com
Wed Jan 27 02:21:04 CET 2010
Looks great, we'll try and get a PHP version working too, based on this...
On Tue, Jan 26, 2010 at 3:41 PM, Toby Inkster <mail at tobyinkster.co.uk>wrote:
> 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'<http://example.com/sparql%27>
> );
>
> ### 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>
> _______________________________________________
> foaf-protocols mailing list
> foaf-protocols at lists.foaf-project.org
> http://lists.foaf-project.org/mailman/listinfo/foaf-protocols
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.perlrdf.org/pipermail/dev/attachments/20100127/532b0a91/attachment.html>
More information about the Dev
mailing list