$id = $this->arg('notice');
- $this->notice = Notice::staticGet($id);
+ $this->notice = Notice::staticGet('id', $id);
if (empty($this->notice)) {
// Did we used to have it, and it got deleted?
return false;
}
+ $cur = common_current_user();
+
+ if (!empty($cur)) {
+ $curProfile = $cur->getProfile();
+ } else {
+ $curProfile = null;
+ }
+
+ if (!$this->notice->inScope($curProfile)) {
+ throw new ClientException(_('Not available.'), 403);
+ }
+
$this->profile = $this->notice->getProfile();
if (empty($this->profile)) {