解决组织一级目录二级目录匿名用户问题
This commit is contained in:
parent
a3abf09841
commit
9e17db376a
|
@ -1,5 +1,6 @@
|
|||
class OrgDocumentCommentsController < ApplicationController
|
||||
before_filter :find_organization, :only => [:new, :create, :show, :index]
|
||||
before_filter :authorize_allowed, :only => [:create, :add_reply]
|
||||
helper :attachments,:organizations
|
||||
layout 'base_org'
|
||||
|
||||
|
@ -101,6 +102,13 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
@organization = Organization.find(params[:organization_id])
|
||||
end
|
||||
|
||||
def authorize_allowed
|
||||
unless User.current.logged?
|
||||
redirect_to signin_url
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||
@org_sub_id = @org_document_comment.org_subfield_id
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class SubDocumentCommentsController < ApplicationController
|
||||
before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit]
|
||||
before_filter :find_subfield_content, :only => [:show, :index]
|
||||
before_filter :authorize_allowed, :only => [:create, :add_reply]
|
||||
helper :attachments,:organizations
|
||||
layout 'base_sub_domain'
|
||||
|
||||
|
@ -207,4 +208,11 @@ class SubDocumentCommentsController < ApplicationController
|
|||
def find_subfield_content
|
||||
@subfield_content = @organization.org_subfields.order("priority")
|
||||
end
|
||||
|
||||
def authorize_allowed
|
||||
unless User.current.logged?
|
||||
redirect_to signin_url
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue