Created
March 15, 2013 09:43
-
-
Save lubyk/5168670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClubsController < ApplicationController | |
before_filter :check_is_admin | |
layout :admin_layout | |
def club | |
attrs = secure(Node) { Node.transform_attributes(attrs) } | |
zip = attrs.delete('parent_zip') | |
parent = visitor.find_node(nil, zip, nil, request) | |
if !parent.can_write? && !visitor.exec_acl | |
# Try to use ACL | |
parent = visitor.find_node(nil, zip, nil, request) || parent | |
end | |
@node = parent.new_child(attrs, false) | |
if @node.save | |
@group = Group.create(@node.title) | |
@node.wgroup_id = @group.id | |
@node.save | |
end | |
redirect_to params[:redir] || zen_path(@node, :mode => params[:mode], :new => 'true') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment