权限访问控制

This commit is contained in:
huang 2016-03-30 19:31:43 +08:00
parent 8f43341f81
commit 5621f01284
1 changed files with 14 additions and 10 deletions

View File

@ -71,16 +71,20 @@ class OrganizationsController < ApplicationController
def show
# 组织新类型 show_mode判断标准 1为新类型0为旧
if @organization.show_mode == 1 && params[:org_subfield_id].nil? && params[:type] .nil?
@subfield_content = @organization.org_subfields.order("priority")
# 项目两种动态
@project_issue_acts = get_project_issue_activities_org @organization
@project_message_acts = get_project_message_activities_org @organization
# 磕碜动态
#@project_acts_issues = get_project_activities_org @organization
@course_acts_homework = get_course_homework_activities_org @organization
@course_acts_message = get_course_message_activities_org @organization
@course_acts_news = get_course_news_activities_org @organization
render :layout => 'base_org_newstyle'
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@subfield_content = @organization.org_subfields.order("priority")
# 项目两种动态
@project_issue_acts = get_project_issue_activities_org @organization
@project_message_acts = get_project_message_activities_org @organization
# 磕碜动态
#@project_acts_issues = get_project_activities_org @organization
@course_acts_homework = get_course_homework_activities_org @organization
@course_acts_message = get_course_message_activities_org @organization
@course_acts_news = get_course_news_activities_org @organization
render :layout => 'base_org_newstyle'
else
render_403
end
else
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@organization = Organization.find(params[:id])