# Copyright (c) 2005-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: CalendarEventList.bunit,v 1.6 2010/01/23 23:53:01 nagler Exp $ ListModel(); my($create_list, $rows) = do('./CalendarEvent.PL'); my($event) = $create_list->(); req()->set_realm_and_user(qw(fourem btest_admin)) ->initialize_fully('FORUM_CALENDAR'); [ load_all => [ [] => [$rows->(qr{^07})], sub { req()->set_realm('btest_admin'); return []; } => [$rows->(qr{^0[78]})], ], map({ my($user, $any, $fourem_sub2) = @$_; ( load_all => [ sub { req()->set_user($user); return []; } => not_die(), ], can_user_edit_any_realm => $any, { method => 'can_user_edit_this_realm', compute_params => sub { my(undef, $params, undef, $object) = @_; $object->find_row_by('CalendarEvent.realm_id' => realm_id($params->[0])); return []; }, } => [ fourem => 0, 'fourem-sub2' => $fourem_sub2, ], ); } [qw(btest_admin 1 1)], [qw(btest_read 0 0)], ), ];