Add gather moderators

Fix few gather issues
This commit is contained in:
Ari Timonen 2019-05-19 18:03:58 -04:00
parent cf3f5676b0
commit 6122caa125
3 changed files with 4 additions and 4 deletions

View file

@ -149,7 +149,7 @@ class Gatherer < ActiveRecord::Base
def can_update? cuser, params = {}
return false unless cuser
if params.keys.include? "username"
if cuser.admin?
if cuser.admin? or cuser.gather_moderator?
return true
else
return false
@ -166,6 +166,6 @@ class Gatherer < ActiveRecord::Base
end
def can_destroy? cuser
cuser and ((user == cuser or cuser.admin?) and gather.status == Gather::STATE_RUNNING)
cuser and ((user == cuser or cuser.admin? or gather_moderator) and gather.status == Gather::STATE_RUNNING)
end
end

View file

@ -9,7 +9,7 @@
<li<% if gatherer.status > 0 %> class="away"<% end %>>
<%= flag gatherer.user.country %>
<%= namelink gatherer.user %>
<% if cuser and cuser.admin? %>
<% if cuser and (cuser.admin? or cuser.gather_moderator?) %>
<%= link_to gatherer, method: :delete, class: 'delete' do %>
<%= icon 'times' %>
<% end %>

View file

@ -69,7 +69,7 @@
<%= link_to "Mute", '#', id: "mute", class: 'button tiny' %>
<% if cuser and cuser.admin? %>
<% if cuser and (cuser.admin? or cuser.gather_moderators?) %>
<%= link_to "Admin Page", edit_gather_url, class: 'admin button' %>
<% end %>
</div>