竞赛通知增加权限限制

This commit is contained in:
wanglinchun 2014-06-12 10:59:05 +08:00
parent bb06ee921a
commit 60bdff86a1
2 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to_user(contestnotifications.author) if contestnotifications.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"> <strong><%= link_to_user(contestnotifications.author) if contestnotifications.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter">
<%= l(:label_project_notice) %></span><span><%= link_to h(contestnotifications.title), contest_contestnotification_path(@contest, contestnotifications) %></span> <%= l(:label_project_notice) %></span><span><%= link_to h(contestnotifications.title), contest_contestnotification_path(@contest, contestnotifications) %></span>
<span style="float: right"><%= delete_link contest_contestnotification_path(@contest, contestnotifications) if true || User.current.allowed_to?(:manage_contestnotifications, @contest) %> </span> <span style="float: right"><%= delete_link contest_contestnotification_path(@contest, contestnotifications) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %> </span>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -5,7 +5,7 @@
:class => 'icon icon-edit', :class => 'icon icon-edit',
:accesskey => accesskey(:edit), :accesskey => accesskey(:edit),
:onclick => '$("#edit-contestnotifications").show(); return true;') if User.current %> :onclick => '$("#edit-contestnotifications").show(); return true;') if User.current %>
<%= delete_link contest_contestnotification_path(@contest, @contestnotification) if User.current %> <%= delete_link contest_contestnotification_path(@contest, @contestnotification) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
</div> </div>
<h3><strong><%=h @contestnotification.title %></strong></h3> <h3><strong><%=h @contestnotification.title %></strong></h3>