Added fix for multitenant error (#394)

* Added fix for multitenant error

* Fixed issue with room lock when using ldap

* Fixed test cases

* Fixed rubocop issue

* Included internal documentation for LDAP ENV variables
This commit is contained in:
farhatahmad 2019-03-13 15:56:57 -04:00 committed by Jesus Federico
parent 08f6f32779
commit c0b46be547
5 changed files with 14 additions and 2 deletions

View File

@ -24,7 +24,8 @@ class RoomsController < ApplicationController
unless: -> { !Rails.configuration.enable_email_verification }
before_action :find_room, except: :create
before_action :verify_room_ownership, except: [:create, :show, :join, :logout]
before_action :verify_room_owner_verified, only: [:show, :join]
before_action :verify_room_owner_verified, only: [:show, :join],
unless: -> { !Rails.configuration.enable_email_verification }
# POST /
def create

View File

@ -18,6 +18,9 @@
module APIConcern
extend ActiveSupport::Concern
RETURNCODE_SUCCESS = "SUCCESS"
def bbb_endpoint
Rails.configuration.bigbluebutton_endpoint
end

View File

@ -27,7 +27,6 @@ class Room < ApplicationRecord
belongs_to :owner, class_name: 'User', foreign_key: :user_id
RETURNCODE_SUCCESS = "SUCCESS"
META_LISTED = "gl-listed"
# Determines if a user owns a room.

View File

@ -56,6 +56,13 @@ OFFICE365_SECRET=
#
# http://docs.bigbluebutton.org/install/greenlight-v2.html#ldap-auth
#
# LDAP_SERVER=ldap.example.com
# LDAP_PORT=389
# LDAP_METHOD=plain
# LDAP_UID=uid
# LDAP_BASE=dc=example,dc=com
# LDAP_BIND_DN=cn=admin,dc=example,dc=com
# LDAP_PASSWORD=password
LDAP_SERVER=
LDAP_PORT=
LDAP_METHOD=

View File

@ -74,6 +74,7 @@ describe RoomsController, type: :controller do
end
it "redirects to root if owner of room is not verified" do
allow(Rails.configuration).to receive(:enable_email_verification).and_return(true)
@owner.update_attribute(:email_verified, false)
post :show, params: { room_uid: @owner.main_room }
@ -162,6 +163,7 @@ describe RoomsController, type: :controller do
end
it "redirects to root if owner of room is not verified" do
allow(Rails.configuration).to receive(:enable_email_verification).and_return(true)
@owner.update_attribute(:email_verified, false)
post :join, params: { room_uid: @room, join_name: @owner.name }