Looks great, we'll try and get a PHP version working too, based on this...<br><br><div class="gmail_quote">On Tue, Jan 26, 2010 at 3:41 PM, Toby Inkster <span dir="ltr"><<a href="mailto:mail@tobyinkster.co.uk">mail@tobyinkster.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><a href="http://search.cpan.org/dist/RDF-ACL/" target="_blank">http://search.cpan.org/dist/RDF-ACL/</a><br>
(Uploaded 15 minutes ago, but may take a while to appear.)<br>
<br>
The RDF::ACL Perl module implements access control lists using the ACL<br>
vocab <<a href="http://www.w3.org/ns/auth/acl" target="_blank">http://www.w3.org/ns/auth/acl</a>>. It works quite nicely with my<br>
FOAF+SSL module; something like this...<br>
<br>
### First you load up your access control list:<br>
<br>
my $acl = RDF::ACL->new('acl.turtle');<br>
# Or even... $acl = RDF::ACL->new('<a href="http://example.com/sparql%27" target="_blank">http://example.com/sparql'</a>);<br>
<br>
### Then you need to authenticate your user.<br>
### Using FOAF+SSL is a sensible method:<br>
<br>
my $webid = '<a href="http://example.net/anon#me" target="_blank">http://example.net/anon#me</a>'; # default<br>
my $authentication = CGI::Auth::FOAF_SSL->new_from_cgi( CGI->new );<br>
if ($authentication->is_secure)<br>
{<br>
$webid = $authentication->agent->identity;<br>
}<br>
<br>
### Then, let's assume they're trying to access<br>
### <<a href="https://example.com/private/document" target="_blank">https://example.com/private/document</a>><br>
<br>
my $document = '<a href="https://example.com/private/document" target="_blank">https://example.com/private/document</a>';<br>
<br>
if ( $acl->check($webid,$document,'read') )<br>
{<br>
# output document<br>
}<br>
else<br>
{<br>
# output error message<br>
}<br>
<font color="#888888"><br>
--<br>
Toby A Inkster<br>
<mailto:<a href="mailto:mail@tobyinkster.co.uk">mail@tobyinkster.co.uk</a>><br>
<<a href="http://tobyinkster.co.uk" target="_blank">http://tobyinkster.co.uk</a>><br>
_______________________________________________<br>
foaf-protocols mailing list<br>
<a href="mailto:foaf-protocols@lists.foaf-project.org">foaf-protocols@lists.foaf-project.org</a><br>
<a href="http://lists.foaf-project.org/mailman/listinfo/foaf-protocols" target="_blank">http://lists.foaf-project.org/mailman/listinfo/foaf-protocols</a><br>
</font></blockquote></div><br>