Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php |
— | — | @@ -500,32 +500,34 @@ |
501 | 501 | $instanceOut .= Html::element( 'td', array(), $instance->getAvailabilityZone() ); |
502 | 502 | $instanceOut .= Html::element( 'td', array(), $instance->getImageId() ); |
503 | 503 | $instanceOut .= Html::element( 'td', array(), $instance->getLaunchTime() ); |
504 | | - $msg = wfMsgHtml( 'openstackmanager-delete' ); |
505 | | - $link = $sk->link( $this->getTitle(), $msg, array(), |
| 504 | + if ( $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
| 505 | + $msg = wfMsgHtml( 'openstackmanager-delete' ); |
| 506 | + $link = $sk->link( $this->getTitle(), $msg, array(), |
506 | 507 | array( 'action' => 'delete', |
507 | 508 | 'project' => $project, |
508 | 509 | 'instanceid' => $instance->getInstanceId() ) ); |
509 | | - $actions = Html::rawElement( 'li', array(), $link ); |
510 | | - $msg = wfMsgHtml( 'openstackmanager-reboot' ); |
511 | | - $link = $sk->link( $this->getTitle(), $msg, array(), |
| 510 | + $actions = Html::rawElement( 'li', array(), $link ); |
| 511 | + $msg = wfMsgHtml( 'openstackmanager-reboot' ); |
| 512 | + $link = $sk->link( $this->getTitle(), $msg, array(), |
512 | 513 | array( 'action' => 'reboot', |
513 | 514 | 'project' => $project, |
514 | 515 | 'instanceid' => $instance->getInstanceId() ) ); |
515 | | - $actions .= Html::rawElement( 'li', array(), $link ); |
516 | | - $msg = wfMsgHtml( 'openstackmanager-configure' ); |
517 | | - $link = $sk->link( $this->getTitle(), $msg, array(), |
| 516 | + $actions .= Html::rawElement( 'li', array(), $link ); |
| 517 | + $msg = wfMsgHtml( 'openstackmanager-configure' ); |
| 518 | + $link = $sk->link( $this->getTitle(), $msg, array(), |
518 | 519 | array( 'action' => 'configure', |
519 | 520 | 'project' => $project, |
520 | 521 | 'instanceid' => $instance->getInstanceId() ) ); |
521 | | - $actions .= Html::rawElement( 'li', array(), $link ); |
522 | | - $msg = wfMsgHtml( 'openstackmanager-getconsoleoutput' ); |
523 | | - $link = $sk->link( $this->getTitle(), $msg, array(), |
| 522 | + $actions .= Html::rawElement( 'li', array(), $link ); |
| 523 | + $msg = wfMsgHtml( 'openstackmanager-getconsoleoutput' ); |
| 524 | + $link = $sk->link( $this->getTitle(), $msg, array(), |
524 | 525 | array( 'action' => 'consoleoutput', |
525 | 526 | 'project' => $project, |
526 | 527 | 'instanceid' => $instance->getInstanceId() ) ); |
527 | | - $actions .= Html::rawElement( 'li', array(), $link ); |
528 | | - $actions = Html::rawElement( 'ul', array(), $actions ); |
529 | | - $instanceOut .= Html::rawElement( 'td', array(), $actions ); |
| 528 | + $actions .= Html::rawElement( 'li', array(), $link ); |
| 529 | + $actions = Html::rawElement( 'ul', array(), $actions ); |
| 530 | + $instanceOut .= Html::rawElement( 'td', array(), $actions ); |
| 531 | + } |
530 | 532 | if ( isset( $projectArr["$project"] ) ) { |
531 | 533 | $projectArr["$project"] .= Html::rawElement( 'tr', array(), $instanceOut ); |
532 | 534 | } else { |
— | — | @@ -534,13 +536,13 @@ |
535 | 537 | } |
536 | 538 | foreach ( $userProjects as $project ) { |
537 | 539 | $out .= Html::element( 'h2', array(), $project ); |
538 | | - $out .= $sk->link( $this->getTitle(), wfMsgHtml( 'openstackmanager-createinstance' ), array(), |
539 | | - array( 'action' => 'create', 'project' => $project ) ); |
| 540 | + if ( $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
| 541 | + $out .= $sk->link( $this->getTitle(), wfMsgHtml( 'openstackmanager-createinstance' ), array(), array( 'action' => 'create', 'project' => $project ) ); |
| 542 | + } |
540 | 543 | if ( isset( $projectArr["$project"] ) ) { |
541 | 544 | $projectOut = $header; |
542 | 545 | $projectOut .= $projectArr["$project"]; |
543 | | - $out .= Html::rawElement( 'table', |
544 | | - array( 'id' => 'novainstancelist', 'class' => 'wikitable sortable collapsible' ), $projectOut ); |
| 546 | + $out .= Html::rawElement( 'table', array( 'id' => 'novainstancelist', 'class' => 'wikitable sortable collapsible' ), $projectOut ); |
545 | 547 | } |
546 | 548 | } |
547 | 549 | |