forked from External/greenlight
Added room configuration tab to admin panel
This commit is contained in:
@ -27,7 +27,8 @@ class Ability
|
||||
else
|
||||
highest_role = user.highest_priority_role
|
||||
if highest_role.get_permission("can_edit_site_settings")
|
||||
can [:site_settings, :update_settings, :coloring, :registration_method], :admin
|
||||
can [:site_settings, :room_configuration, :update_settings,
|
||||
:update_room_configuration, :coloring, :registration_method], :admin
|
||||
end
|
||||
|
||||
if highest_role.get_permission("can_edit_roles")
|
||||
|
@ -58,6 +58,23 @@ class Setting < ApplicationRecord
|
||||
Rails.configuration.number_of_rooms_default
|
||||
when "Shared Access"
|
||||
Rails.configuration.shared_access_default
|
||||
when "Room Configuration Mute On Join"
|
||||
room_config_setting("mute-on-join")
|
||||
when "Room Configuration Require Moderator"
|
||||
room_config_setting("require-moderator-approval")
|
||||
when "Room Configuration Allow Any Start"
|
||||
room_config_setting("anyone-can-start")
|
||||
when "Room Configuration All Join Moderator"
|
||||
room_config_setting("all-join-moderator")
|
||||
end
|
||||
end
|
||||
|
||||
# Check if the room setting is currently enabled in .env, return disabled if not and return optional if it is
|
||||
def room_config_setting(name)
|
||||
if Rails.configuration.room_features.include?(name)
|
||||
"optional"
|
||||
else
|
||||
"disabled"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user