Added setting for admin to limit the number of rooms for the user (#607)

This commit is contained in:
farhatahmad
2019-07-09 10:56:06 -04:00
committed by Jesus Federico
parent 4f2b190239
commit e4f50026f1
13 changed files with 171 additions and 30 deletions

View File

@ -23,7 +23,7 @@ class AdminsController < ApplicationController
manage_users = [:edit_user, :promote, :demote, :ban_user, :unban_user, :approve]
site_settings = [:branding, :coloring, :coloring_lighten, :coloring_darken,
:registration_method, :room_authentication]
:registration_method, :room_authentication, :room_limit]
authorize_resource class: false
before_action :find_user, only: manage_users
@ -153,6 +153,12 @@ class AdminsController < ApplicationController
end
end
# POST /admins/room_limit
def room_limit
@settings.update_value("Room Limit", params[:limit])
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") }
end
private
def find_user