diff Lib/IMPL/Security/Context.pm @ 194:4d0e1962161c

Replaced tabs with spaces IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author cin
date Tue, 10 Apr 2012 20:08:29 +0400
parents d1676be8afcc
children 6d8092d8ce1b
line wrap: on
line diff
--- a/Lib/IMPL/Security/Context.pm	Tue Apr 10 08:13:22 2012 +0400
+++ b/Lib/IMPL/Security/Context.pm	Tue Apr 10 20:08:29 2012 +0400
@@ -21,9 +21,9 @@
 }
 
 sub CTOR {
-	my ($this) = @_;
-	
-	die new IMPL::InvalidArgumentException("The parameter is required", 'principal') unless $this->principal;
+    my ($this) = @_;
+    
+    die new IMPL::InvalidArgumentException("The parameter is required", 'principal') unless $this->principal;
 }
 
 sub Impersonate {
@@ -35,11 +35,11 @@
     my $e;
     
     {
-	    local $@;
-	    eval {
-	        $result = $code->();
-	    };
-	    $e = $@;
+        local $@;
+        eval {
+            $result = $code->();
+        };
+        $e = $@;
     }
     $current = $old;
     if($e) {
@@ -50,19 +50,19 @@
 }
 
 sub Apply {
-	my ($this) = @_;
-	
-	$current = $this;
+    my ($this) = @_;
+    
+    $current = $this;
 }
 
 sub isTrusted {
-	my ($this) = @_;
-	
-	if (my $auth = $this->auth) {
-		return $auth->isTrusted;
-	} else {
-		return 0;
-	}
+    my ($this) = @_;
+    
+    if (my $auth = $this->auth) {
+        return $auth->isTrusted;
+    } else {
+        return 0;
+    }
 }
 
 sub nobody {
@@ -72,18 +72,18 @@
 }
 
 sub current {
-	my ($self) = @_;
-	
-	$current = __PACKAGE__->nobody unless $current;
-	$current;
+    my ($self) = @_;
+    
+    $current = __PACKAGE__->nobody unless $current;
+    $current;
 }
 
 sub Satisfy {
-	my ($this,@roles) = @_;
-	
-	my $roleEffective = new IMPL::Security::Role ( _effective => scalar $this->rolesAssigned );
-	
-	return $roleEffective->Satisfy(@roles);
+    my ($this,@roles) = @_;
+    
+    my $roleEffective = new IMPL::Security::Role ( _effective => scalar $this->rolesAssigned );
+    
+    return $roleEffective->Satisfy(@roles);
 }
 
 1;
@@ -103,9 +103,9 @@
 my $context = IMPL::Security::Context->nobody;
 
 my $result = $context->Impersonate(
-	sub {
-		# do some untrusted code
-	}
+    sub {
+        # do some untrusted code
+    }
 );
 
 =end code