1.权限管理问题

This commit is contained in:
ouyangxuhua 2015-12-30 17:45:15 +08:00
parent b1dbe61072
commit 29c720a8a4
3 changed files with 5 additions and 3 deletions

View File

@ -231,8 +231,10 @@ class MessagesController < ApplicationController
@isReply = false
if @project
(render_403; return false) unless @message.editable_by?(User.current)
else
elsif @course
(render_403; return false) unless @message.course_editable_by?(User.current)
else
(render_403; return false) unless @message.org_subfield_editable_by?(User.current)
end
@message.safe_attributes = params[:message]

View File

@ -9,7 +9,7 @@
</li>
<% end %>
<% else %>
<li><span class="mt3 fl mr5">暂无资源栏目</span></li>
<li><span class="mt3 fl mr5">暂无帖子栏目</span></li>
<% end %>
<% else %>
<span class="fontBlue pl10">请在左侧选择组织</span>

View File

@ -11,7 +11,7 @@
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.board.org_subfield.name.to_s+" | 资源栏目讨论区",org_subfield_boards_path(activity.board.org_subfield), :class => "newsBlue ml15 mr5"%>
<%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",org_subfield_boards_path(activity.board.org_subfield), :class => "newsBlue ml15 mr5"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.board.org_subfield.name %>(项目讨论区)</a>-->
</div>
<div class="homepagePostTitle break_word">