diff Lib/IMPL/Web/Application/Resource.pm @ 330:fe725fad2d90

Added access checking to web resources
author sergey
date Tue, 04 Jun 2013 19:25:54 +0400
parents 546957c50a36
children 04a093f0a5a6
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/Resource.pm	Mon Jun 03 18:03:54 2013 +0400
+++ b/Lib/IMPL/Web/Application/Resource.pm	Tue Jun 04 19:25:54 2013 +0400
@@ -54,6 +54,8 @@
     die NotAllowedException->new(
         allow => join( ',', map( uc, keys %{ $this->contract->verbs } ) ) )
       unless $operation;
+      
+    $this->AccessCheck($verb);
 
 # в случае, когда один ресурс вызывает HTTP метод другого ресурса, нужно
 # сохранить оригинальный resourceLocation
@@ -70,6 +72,10 @@
     return _InvokeDelegate($operation, $this, $action );
 }
 
+sub AccessCheck {
+	
+}
+
 sub PrepareEnvironment {
     my ($this) = @_;
     
@@ -89,6 +95,8 @@
 # в контракте.
 sub FetchChildResource {
     my ( $this, $childId ) = @_;
+    
+    $this->AccessCheck('FETCH');
 
     my ( $info, $childIdParts ) =
       $this->contract->FindChildResourceInfo($childId);