# Copyright (c) 2009 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: RealmFeatureForm.bunit,v 1.7 2010/01/27 06:10:08 nagler Exp $ FormModel(); req()->set_realm_and_user('fourem', 'root'); my($params) = sub { my(@params) = @_; return { map(($_ => 0), qw( feature_blog feature_calendar feature_mail feature_motion feature_tuple mail_want_reply_to )), mail_send_access => MailSendAccess()->ALL_MEMBERS, map(($_ =~ /^[A-Z]/ ? (mail_send_access => MailSendAccess()->$_()) : ($_ => 1)), @params), }; }; my($case) = sub { my($params) = $params->(@_); return ( [$params] => not_die(), empty_case($params), ); }; [ empty_case($params->(qw( ALL_MEMBERS feature_blog feature_calendar feature_mail feature_motion feature_tuple mail_want_reply_to ))), $case->(qw( ALL_ADMINS feature_calendar feature_mail feature_tuple mail_want_reply_to )), inline_case(sub {req()->set_realm('demo')}), $case->(qw( NOBODY feature_calendar )), $case->(qw( EVERYBODY mail_want_reply_to feature_calendar feature_motion )), inline_case(sub {req()->set_realm(undef)}), empty_case($params->(qw( feature_blog feature_calendar feature_mail feature_motion feature_tuple ALL_MEMBERS mail_want_reply_to ))), ];