Don't send notified emails to non owner

master
Daniel Berteaud 10 years ago
parent 54a2dce8bf
commit 15c3980792
  1. 1
      public/js/vroom.js
  2. 5
      vroom.pl

@ -784,6 +784,7 @@ function initVroom(room) {
success: function(data){
if (id === peers.local.id){
if (data.role != peers.local.role){
getRoomInfo();
webrtc.sendToAll('role_change', {});
}
peers.local.role = data.role;

@ -1837,8 +1837,9 @@ any '/api' => sub {
# Return just room config
elsif ($req->{action} eq 'get_room_conf'){
my $resp = $self->get_room_conf($room);
my $role = $self->get_key_role($token,$room);
if (!$role || $role !~ m/admin|owner$/){
my $role = $self->get_key_role($token,$room->{name});
if (!$role || $role !~ m/^admin|owner$/){
$self->app->log->debug("API Key $token is not admin, nor owner of room " . $room->{name} . ", blanking out sensible data");
$resp->{notif} = {};
}
return $self->render(

Loading…
Cancel
Save