Skip to content

Commit

Permalink
Check for show redactions ability instead of moderator role when brow…
Browse files Browse the repository at this point in the history
…sing elements
  • Loading branch information
AntonKhorev committed Mar 2, 2024
1 parent 957f139 commit bfaa37e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/abilities/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def initialize(user)
can [:index, :create, :destroy], UserMute

if user.moderator?
can :show_redactions, [:browse, OldNode, OldWay, OldRelation]
can :show_redactions, [:browse, Node, Way, Relation, OldNode, OldWay, OldRelation]
can [:hide, :unhide, :hidecomment, :unhidecomment], DiaryEntry
can [:index, :show, :resolve, :ignore, :reopen], Issue
can :create, IssueComment
Expand Down
2 changes: 1 addition & 1 deletion app/views/browse/_version_actions.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% if !@feature.redacted? %>
&middot;
<%= link_to t("browse.download_xml"), :controller => "api/old_#{@type.pluralize}", :action => :version %>
<% elsif current_user&.moderator? %>
<% elsif can? :show_redactions, @feature %>
&middot;
<% if !params[:show_redactions] %>
<%= link_to t("browse.view_redacted_data"), :params => { :show_redactions => true } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/browse/feature.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
&middot;
<% end %>
<%= link_to t("browse.view_history"), :action => "#{@type}_history" %>
<% if current_user&.moderator? %>
<% if can? :show_redactions, @feature %>
&middot;
<%= link_to(t("browse.view_unredacted_history"), :action => "#{@type}_history", :params => { :show_redactions => true }) %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/browse/history.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<% if params[:show_redactions] %>
&middot;
<%= link_to(t("browse.view_history"), :action => "#{@type}_history") %>
<% elsif current_user&.moderator? %>
<% elsif can? :show_redactions, @feature %>
&middot;
<%= link_to(t("browse.view_unredacted_history"), :action => "#{@type}_history", :params => { :show_redactions => true }) %>
<% end %>
Expand Down

0 comments on commit bfaa37e

Please sign in to comment.