Have just 1 list of groups that should not be deleted.

This commit is contained in:
Colin Kuskie 2009-07-05 20:33:31 +00:00
parent 464202303a
commit da41082cbf
2 changed files with 32 additions and 1 deletions

View file

@ -1561,4 +1561,24 @@ sub userGroupExpireDate {
}
}
#-------------------------------------------------------------------
=head2 vitalGroup ( $groupId )
Class method to check to see if a group is a reserved WebGUI group. Returns
true or false. Placed in here because I found two different lists in two
different areas.
=head3 $groupId
A GUID of the group to check.
=cut
sub vitalGroup {
my $class = shift;
my $groupId = shift;
return isIn ( $groupId, (1..17), qw/pbgroup000000000000015 pbgroup000000000000016 pbgroup000000000000017 / );
}
1;

View file

@ -75,7 +75,7 @@ my @ipTests = (
);
plan tests => (148 + scalar(@scratchTests) + scalar(@ipTests)); # increment this value for each test you create
plan tests => (152 + scalar(@scratchTests) + scalar(@ipTests)); # increment this value for each test you create
my $session = WebGUI::Test->session;
my $testCache = WebGUI::Cache->new($session, 'myTestKey');
@ -675,6 +675,17 @@ SKIP: {
#
################################################################
################################################################
#
# vitalGroup
#
################################################################
ok( WebGUI::Group->vitalGroup(7), 'vitalGroup: 7');
ok( WebGUI::Group->vitalGroup(3), '... 3');
ok( WebGUI::Group->vitalGroup('pbgroup000000000000015'), '... pbgroup000000000000015');
ok(! WebGUI::Group->vitalGroup('27'), '... 27 is not vital');
END {
$session->db->dbh->do('DROP TABLE IF EXISTS myUserTable');
$testCache->flush;