restrict min level constraints for forum topics to mod+admin and restrict options based on current user's level. check privileges for visiblity in forum posts and topics. deprecate serializable_hash (undocumented, internal) for as_json, refactor to use hidden_attributes and method_attributes #2658
This commit is contained in:
@@ -18,12 +18,9 @@
|
||||
<% end %>
|
||||
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
<%= f.input :is_sticky %>
|
||||
<%= f.input :is_locked %>
|
||||
<% end %>
|
||||
|
||||
<% if CurrentUser.is_builder? %>
|
||||
<%= f.input :min_level, :as => :select, :collection => User.level_hash.to_a %>
|
||||
<%= f.input :min_level, :as => :select, :collection => ForumTopic.available_min_user_levels.to_a %>
|
||||
<%= f.input :is_sticky, :label => "Sticky" %>
|
||||
<%= f.input :is_locked, :label => "Locked" %>
|
||||
<% end %>
|
||||
|
||||
<%= f.button :submit, "Submit", :data => { :disable_with => "Submitting..." } %>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Topic: <%= @forum_topic.title %>
|
||||
|
||||
<% if @forum_topic.min_level >= User::Levels::BUILDER %>
|
||||
<span class="level-topic">(<%= User.level_string(@forum_topic.min_level).downcase %> only)</span>
|
||||
<span class="level-topic">(<%= User.level_string(@forum_topic.min_level).downcase %>+ only)</span>
|
||||
<% end %>
|
||||
|
||||
<% if @forum_topic.is_deleted? %>
|
||||
|
||||
Reference in New Issue
Block a user