diff Lib/IMPL/Security/AbstractContext.pm @ 330:fe725fad2d90

Added access checking to web resources
author sergey
date Tue, 04 Jun 2013 19:25:54 +0400
parents 2879cdb6b8cd
children
line wrap: on
line diff
--- a/Lib/IMPL/Security/AbstractContext.pm	Mon Jun 03 18:03:54 2013 +0400
+++ b/Lib/IMPL/Security/AbstractContext.pm	Tue Jun 04 19:25:54 2013 +0400
@@ -6,6 +6,7 @@
 
 use IMPL::require {
     Role => 'IMPL::Security::Role',
+    Principal => 'IMPL::Security::Principal',
     Exception => 'IMPL::Exception',
     NotImplementedException => '-IMPL::NotImplementedException'
 };
@@ -60,6 +61,10 @@
     }
 }
 
+sub isNobody {
+    return (shift->principal == Principal->nobody ? 1 : 0);
+}
+
 sub Satisfy {
     my ($this,@roles) = @_;