Skip to content

Instantly share code, notes, and snippets.

@lestrrat
Created September 6, 2009 13:44
Show Gist options
  • Save lestrrat/181807 to your computer and use it in GitHub Desktop.
Save lestrrat/181807 to your computer and use it in GitHub Desktop.
--- a/lib/Werewolf/BBS/Controller/Chatter.pm
+++ b/lib/Werewolf/BBS/Controller/Chatter.pm
@@ -177,8 +177,17 @@ sub view
my $village = $c->stash->{village};
my $chatter_api = $self->api('Chatter');
- my $chat = $chatter_api->find( $chat_id );
- if (! $chat || $chat->village_id ne $village->id) {
+
+ my $chat;
+ {
+ my $where = $self->build_where_with_visibility(
+ village_id => $c->stash->{village_id},
+ member_id => $c->user->id,
+ );
+ local $chatter_api->{resultset_constraints} = $where;
+ $chat = $chatter_api->find( $chat_id );
+ }
+ if (! $chat ) {
Pixis::Web::Exception::FileNotFound->throw();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment