diff Lib/IMPL/Security.pm @ 245:7c517134c42f

Added Unsupported media type Web exception corrected resourceLocation setting in the resource Implemented localizable resources for text messages fixed TT view scopings, INIT block in controls now sets globals correctly.
author sergey
date Mon, 29 Oct 2012 03:15:22 +0400
parents 6d8092d8ce1b
children 2270de2469ff
line wrap: on
line diff
--- a/Lib/IMPL/Security.pm	Mon Oct 22 04:09:27 2012 +0400
+++ b/Lib/IMPL/Security.pm	Mon Oct 29 03:15:22 2012 +0400
@@ -5,6 +5,7 @@
 ##VERSION##
 
 require IMPL::Exception;
+require IMPL::Security::Principal;
 require IMPL::Security::AbstractContext;
 require IMPL::Security::Rule::RoleCheck;
 
@@ -48,6 +49,17 @@
     return $authority;
 }
 
+sub principal {
+    return
+        IMPL::Security::AbstractContext->current
+        && IMPL::Security::AbstractContext->current->principal
+        || IMPL::Security::Principal->nobody; 
+}
+
+sub context {
+    IMPL::Security::AbstractContext->current;
+}
+
 1;
 
 __END__