# Copyright (c) 2010 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: AuthUserRealmList.bunit,v 1.3 2010/02/21 16:45:59 nagler Exp $ ListModel(); req()->set_realm_and_user('fourem')->initialize_fully('GROUP_USER_LIST'); [ { method => 'load_all_for_task', compute_params => sub { my(undef, $actual) = @_; req()->set_user($actual->[0]); return [$actual->[1] || undef]; }, } => [ btest_read => [], [qw(btest_admin FORUM_CALENDAR_EVENT_DETAIL)] => [ {'RealmOwner.name' => 'btest_admin'}, {'RealmOwner.name' => 'fourem'}, {'RealmOwner.name' => 'fourem-sub2'}, ], btest_admin => [{'RealmOwner.name' => 'fourem-sub2'}], ], assert_realm_exists => [ [realm_id('fourem-sub2')] => not_die(), [realm_id('fourem')] => FORBIDDEN(), [undef] => DIE(), ], realm_ids => [ [] => [[realm_id('fourem-sub2')]], ['FORUM_CALENDAR_EVENT_DETAIL'] => [ [map(realm_id($_), qw(btest_admin fourem fourem-sub2))], ], ], inline_case(sub {req()->set_user('calendar_btest_user')}), load_all_for_task => [ 'FORUM_CALENDAR_EVENT_DETAIL' => not_die(), ], { method => 'can_user_execute_task_in_this_realm', compute_params => sub { my($case, $params) = @_; $case->get('object')->find_row_by('RealmOwner.name', shift(@$params)); return [@$params]; }, } => [ [qw(fourem FORUM_CALENDAR_EVENT_DETAIL)] => DIE(), [qw(calendar_btest_main FORUM_CALENDAR_EVENT_DETAIL)] => 1, [qw(calendar_btest_main FORUM_CALENDAR_EVENT_FORM)] => 1, [qw(calendar_btest_read_only FORUM_CALENDAR_EVENT_DETAIL)] => 1, [qw(calendar_btest_read_only FORUM_CALENDAR_EVENT_FORM)] => 0, ], can_user_execute_task_in_any_realm => [ FORUM_CALENDAR_EVENT_FORM => 1, SITE_ADMIN_USER_LIST => 0, ], ];