--- loncom/homework/bridgetask.pm	2005/08/09 16:48:15	1.39
+++ loncom/homework/bridgetask.pm	2005/08/15 19:36:21	1.40
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.39 2005/08/09 16:48:15 albertel Exp $
+# $Id: bridgetask.pm,v 1.40 2005/08/15 19:36:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -147,8 +147,8 @@ sub add_grading_button {
     my $result=' <input type="submit" name="gradeasubmission" value="'.
 	&mt("Get a submission to grade").'" />';
     $result.='<input type="hidden" name="grade_target" value="webgrade" />';
-    if ( 1) {
-	#need a permissions for limitng this to 'powerful users'
+    if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
+	# FIXME need a permission for limiting this to 'powerful users'
 
 	my ($entries,$ready,$locks)=&get_queue_counts('gradingqueue');
 	$result.='<p>'.&mt("Grading Queue has [_1] entries. [_2] of them are ready to be graded and [_3] of them are currently being graded",$entries,$ready,$locks);
@@ -225,13 +225,14 @@ sub start_Task {
 	    if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); }
 	    $body_tag_start.=$uri.'">'.&add_grading_button()."</form>";
 	    my $symb=&Apache::lonnet::symbread();
-	    $body_tag_start.='<form method="POST" action="/adm/slotrequest">'.
-		'<input type="hidden" name="symb" value="'.$symb.'" />'.
-		'<input type="hidden" name="command" value="showslots" />'.
-		'<input type="submit" name="requestattempt" value="'.
-		&mt('Show Slot list').'" />'.
-		'</form>';
-
+	    if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
+		$body_tag_start.='<form method="POST" action="/adm/slotrequest">'.
+		    '<input type="hidden" name="symb" value="'.$symb.'" />'.
+		    '<input type="hidden" name="command" value="showslots" />'.
+		    '<input type="submit" name="requestattempt" value="'.
+		    &mt('Show Slot list').'" />'.
+		    '</form>';
+	    }
 	}
     }
     if ($target eq 'web' || ($target eq 'grade' && !$env{'form.webgrade'}) || $target eq 'answer' ||
@@ -285,7 +286,7 @@ sub start_Task {
 	    } elsif ($target eq 'grade' && !$env{'form.webgrade'}) {
 		if ($status eq 'NEEDS_CHECKIN') {
 		    if (&proctor_check_auth($slot_name,$slot)) {
-			#FIXME immeadiatly add this to the grading queue
+			# FIXME immeadiatly add this to the grading queue
                         #      with slot->{'endtime'} for when grading can 
                         #      begin on this resource
 			# FIXME I think the above is done by default,
@@ -539,7 +540,6 @@ sub end_Task {
 		}
 	    } elsif ($ungraded) {
 		$Apache::lonhomework::results{"resource.$version.status"}='ungraded';
-		# FIXME if in review queue need to move back to grading queue
 		if ($env{'form.queue'} eq 'reviewqueue') {
 		    &Apache::lonxml::debug("moving back.");
 		    &move_between_queues('reviewqueue','gradingqueue');