diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb index d5028b217..8d5f4ec20 100644 --- a/app/controllers/admin/accounts_controller.rb +++ b/app/controllers/admin/accounts_controller.rb @@ -29,7 +29,8 @@ def update private def account_params - params.require(:account).permit(:name, :cname, :title, *@account.public_settings.keys) + is_superadmin = current_ability.superadmin? + params.require(:account).permit(:name, :cname, :title, *@account.public_settings(is_superadmin: is_superadmin).keys) end def set_current_account diff --git a/app/views/admin/accounts/edit.html.erb b/app/views/admin/accounts/edit.html.erb index 533aa0a07..f759e6190 100644 --- a/app/views/admin/accounts/edit.html.erb +++ b/app/views/admin/accounts/edit.html.erb @@ -1,7 +1,6 @@ <% content_for :page_header do %>

Editing Account

<% end %> -
<% end %> -
<%= f.label :tenant %>
<%= f.text_field :tenant, class: 'form-control', readonly: @account.persisted? %>
- - <% current_account.public_settings.each do |key, value| %> + <% is_superadmin = current_ability.superadmin? %> + <% current_account.public_settings(is_superadmin: is_superadmin).each do |key, value| %> <%= render 'shared/settings', f: f, key: key, value: value %> <% end %> - @@ -34,4 +31,4 @@ <% end %>
- + \ No newline at end of file