diff Lib/IMPL/Web/Security.pm @ 393:69a1f1508696

minor security refactoring
author cin
date Fri, 14 Feb 2014 16:41:12 +0400
parents 2287c72f303a
children
line wrap: on
line diff
--- a/Lib/IMPL/Web/Security.pm	Fri Feb 14 03:31:45 2014 +0400
+++ b/Lib/IMPL/Web/Security.pm	Fri Feb 14 16:41:12 2014 +0400
@@ -19,10 +19,27 @@
     ERR_AUTH_FAIL => -5
 };
 
+sub interactiveAuthPackage {
+	die NotImplementedException->new();
+}
+
+sub users {
+	die NotImplementedException->new();
+}
+
+sub roles {
+	die die NotImplementedException->new();
+}
+
+sub sessions {
+	die NotImplementedException->new();
+}
+
 sub AuthUser {
-    my ($this,$name,$challenge,$package) = @_;
+    my ($this,$name,$challenge,$roles,$package) = @_;
     
     $package ||= $this->interactiveAuthPackage;
+    $roles ||= [];
     
     my $user = $this->users->GetById($name)
         or return {
@@ -53,7 +70,7 @@
 
     my $status = SecurityContext->current->authority->InitSession(
         $user,
-        [$user->roles],
+        $roles,
         $auth,
         $challenge
     );