mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-02-21 04:00:34 +09:00
Always just go through the settings object
This commit is contained in:
@@ -32,7 +32,7 @@ class RoomsController < ApplicationController
|
||||
end
|
||||
|
||||
def ensure_permission_to_create_rooms
|
||||
if Current.account.restrict_room_creation_to_administrators? && !Current.user.administrator?
|
||||
if Current.account.settings.restrict_room_creation_to_administrators? && !Current.user.administrator?
|
||||
head :forbidden
|
||||
end
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ class Rooms::ClosedsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "create forbidden by non-admin when account restricts creation to admins" do
|
||||
accounts(:signal).restrict_room_creation_to_administrators = true
|
||||
accounts(:signal).settings.restrict_room_creation_to_administrators = true
|
||||
accounts(:signal).save!
|
||||
|
||||
sign_in :jz
|
||||
|
||||
@@ -25,7 +25,7 @@ class Rooms::OpensControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "create forbidden by non-admin when account restricts creation to admins" do
|
||||
accounts(:signal).restrict_room_creation_to_administrators = true
|
||||
accounts(:signal).settings.restrict_room_creation_to_administrators = true
|
||||
accounts(:signal).save!
|
||||
|
||||
sign_in :jz
|
||||
|
||||
Reference in New Issue
Block a user