function onEndShowNoticeOptionItems($nli)
{
- $notice = $nli->getNotice();
- $out = $nli->getOut();
-
- if (!empty($notice)) {
-
- $score = $this->getScore($notice);
-
- if (empty($score)) {
- $this->debug("No score for notice " . $notice->id);
- // XXX: show a question-mark or something
- } else if ($score->is_spam) {
- $form = new TrainHamForm($out, $notice);
- $form->show();
- } else if (!$score->is_spam) {
- $form = new TrainSpamForm($out, $notice);
- $form->show();
+ $profile = Profile::current();
+
+ if (!empty($profile) && $profile->hasRight(self::TRAINSPAM)) {
+
+ $notice = $nli->getNotice();
+ $out = $nli->getOut();
+
+ if (!empty($notice)) {
+
+ $score = $this->getScore($notice);
+
+ if (empty($score)) {
+ $this->debug("No score for notice " . $notice->id);
+ // XXX: show a question-mark or something
+ } else if ($score->is_spam) {
+ $form = new TrainHamForm($out, $notice);
+ $form->show();
+ } else if (!$score->is_spam) {
+ $form = new TrainSpamForm($out, $notice);
+ $form->show();
+ }
}
}