# Copyright (c) 2006 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: ClientRedirect.bunit,v 1.4 2007/09/18 03:31:56 nagler Exp $ Request('initialize_fully'); set_user('btest_read'); [ class() => [ { method => 'get_realm_for_task', compute_params => sub { my(undef, $params) = @_; return [Bivio::Agent::TaskId->from_name($params->[0]), req()]; }, compute_return => sub { my(undef, $actual) = @_; return [$actual->[0]->unsafe_get('owner_name') || 'general']; }, } => [ SHELL_UTIL => 'general', USER_HOME => 'btest_read', # map_user_realms sorts alphabetically, and fourem is always first FORUM_HOME => 'fourem', ORDER_COMMIT => NOT_FOUND(), ], { method => 'execute_unauth_role_in_realm', compute_params => sub { my(undef, $params) = @_; req()->set_realm('demo'); req()->set_user_state_and_cookie(@$params) ->server_redirect('USER_ROLE_IN_REALM'); return [req()]; }, compute_return => sub { my(undef, $actual) = @_; return [$actual->[0]->{task_id}]; }, } => [ just_visitor => 'just_visitor_task', [qw(logged_in demo)] => 'administrator_task', [qw(logged_out demo)] => 'administrator_task', [qw(logged_in guest)] => 'guest_task', [qw(logged_out guest)] => 'guest_task', [qw(logged_in root)] => 'next', [qw(logged_out root)] => 'next', ], ], ];