forked from GNUsocial/gnu-social
[Poll] Polls now have an associated note, poll templates, start_show_styles event, started css
This commit is contained in:
@@ -21,8 +21,10 @@
|
||||
|
||||
namespace Plugin\Poll\Controller;
|
||||
|
||||
use App\Entity\Note;
|
||||
use App\Entity\Poll;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\NoSuchNoteException;
|
||||
use App\Util\Exception\NotFoundException;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
@@ -55,6 +57,12 @@ class ShowPoll
|
||||
|
||||
$poll = Poll::getFromId((int) $id);
|
||||
|
||||
$note = Note::getFromId($poll->getNoteId());
|
||||
|
||||
if (!$note->isVisibleTo($user)) {
|
||||
throw new NoSuchNoteException();
|
||||
}
|
||||
|
||||
if ($poll == null) {
|
||||
throw new NotFoundException('Poll does not exist');
|
||||
}
|
||||
|
Reference in New Issue
Block a user