[Rt-commit] [svn] r1551 - in rt/branches/3.3-TESTING: html/Elements lib/t

tla at pallas.eruditorum.org tla at pallas.eruditorum.org
Wed Sep 22 18:44:29 EDT 2004


Author: tla
Date: Wed Sep 22 18:44:28 2004
New Revision: 1551

Modified:
   rt/branches/3.3-TESTING/html/Elements/SelectOwner
   rt/branches/3.3-TESTING/lib/t/07acl.pl.in
Log:
SelectOwner can now be passed a list of queues which the user may see.



Modified: rt/branches/3.3-TESTING/html/Elements/SelectOwner
==============================================================================
--- rt/branches/3.3-TESTING/html/Elements/SelectOwner	(original)
+++ rt/branches/3.3-TESTING/html/Elements/SelectOwner	Wed Sep 22 18:44:28 2004
@@ -63,6 +63,9 @@
 elsif ($QueueObj) {
         @objects = ($QueueObj);
 } 
+elsif ($cfqueues) {
+	@objects = keys %{$cfqueues};
+}
 else {
         my $Queues = RT::Queues->new($session{CurrentUser});
 	$Queues->UnLimit();
@@ -94,4 +97,5 @@
 $TicketObj => undef
 $DefaultValue => 1
 $DefaultLabel => "-"
+$cfqueues => undef
 </%ARGS>

Modified: rt/branches/3.3-TESTING/lib/t/07acl.pl.in
==============================================================================
--- rt/branches/3.3-TESTING/lib/t/07acl.pl.in	(original)
+++ rt/branches/3.3-TESTING/lib/t/07acl.pl.in	Wed Sep 22 18:44:28 2004
@@ -9,8 +9,8 @@
 ok($ret, 'ACL test user creation');
 $user_obj->SetName('customer');
 $user_obj->SetPrivileged(1);
-my ($val, $msg) = $user_obj->SetPassword('customer');
-ok($val, "ACL test password set. $msg");
+($ret, $msg) = $user_obj->SetPassword('customer');
+ok($ret, "ACL test password set. $msg");
 
 # Now test the web interface, making sure objects come and go as
 # required.
@@ -50,8 +50,7 @@
 		       text => 'Preferences'), "No prefs pane" );
 
 # Now test for their presence, one at a time.
-my ($val, $msg) = $user_obj->PrincipalObj->GrantRight(Right => 'ShowConfigTab');
-ok($val, "Grant the right. $msg");
+$user_obj->PrincipalObj->GrantRight(Right => 'ShowConfigTab');
 sleep(10);
 $agent->reload();
 ok($agent->{'content'} =~ /Logout/i, "Reloaded page successfully");
@@ -89,4 +88,31 @@
 ok($agent->{'content'} =~ /input\s+type=.submit.\s+name=.Save./i, 
    "Saved searches box exists");
 
+# Create a group, and a queue, so we can test limited user visibility
+# via SelectOwner.
+
+my $queue_obj = RT::Queue->new($RT::SystemUser);
+($ret, $msg) = $queue_obj->Create(Name => 'CustomerQueue', 
+				  Description => 'queue for SelectOwner testing');
+ok($ret, "SelectOwner test queue creation. $msg");
+my $group_obj = RT::Group->new($RT::SystemUser);
+($ret, $msg) = $group_obj->CreateUserDefinedGroup(Name => 'CustomerGroup',
+			      Description => 'group for SelectOwner testing');
+ok($ret, "SelectOwner test group creation. $msg");
+
+# Add our customer to the customer group, and give it queue rights.
+($ret, $msg) = $group_obj->AddMember($user_obj->PrincipalObj->Id());
+ok($ret, "Added customer to its group. $msg");
+$group_obj->PrincipalObj->GrantRight(Right => 'OwnTicket',
+				     Object => $queue_obj);
+$group_obj->PrincipalObj->GrantRight(Right => 'SeeQueue',
+				     Object => $queue_obj);
+
+# Now.  When we look at the search page we should be able to see
+# ourself in the list of possible owners.
+# TODO: Fix
+# $agent->reload();
+# ok($agent->field( 'ValueOfActor', 'customer'),
+#    "Found self in the actor listing");
+
 1;


More information about the Rt-commit mailing list