return false;
}
+ // Is it OK to repeat that notice (general enough scope)?
+
+ if ($this->original->scope != Notice::SITE_SCOPE &&
+ $this->original->scope != Notice::PUBLIC_SCOPE) {
+ // TRANS: Client error displayed when trying to repeat a private notice.
+ $this->clientError(_('You may not repeat a private notice.'),
+ 403,
+ $this->format);
+ return false;
+ }
+
$profile = $this->user->getProfile();
+ // Can the profile actually see that notice?
+
+ if (!$this->original->inScope($profile)) {
+ // TRANS: Client error displayed when trying to repeat a notice the user has no access to.
+ $this->clientError(_('No access to that notice.'),
+ 403,
+ $this->format);
+ return false;
+ }
+
if ($profile->hasRepeated($id)) {
// TRANS: Client error displayed trying to re-repeat a notice through the API.
$this->clientError(_('Already repeated that notice.'),
return false;
}
+
return true;
}