<commit_before>class GroupsController < GroupBaseController
  # TODO Jon: some of the code for tagging in this controller can probably
  # be moved into the model

  load_and_authorize_resource except: :show
  before_filter :check_group_read_permissions, :only => :show

  def create
    build_resource
    @group.add_admin! current_user
    create!
  end

  # CUSTOM CONTROLLER ACTIONS

  def add_subgroup
    @parent = Group.find(params[:group_id])
    @subgroup = Group.new(:parent => @parent)
  end

  def invite_member
    @group = Group.find(params[:id])
    @user = User.new
  end

  def request_membership
    @group = Group.find(params[:id])
    @membership = Membership.new
  end

  def add_user_tag
    group = Group.find(params[:id])
    user = User.find(params[:user_id])<commit_msg>Subgroup inherits parent's privacy settings.<commit_after>class GroupsController < GroupBaseController
  # TODO Jon: some of the code for tagging in this controller can probably
  # be moved into the model

  load_and_authorize_resource except: :show
  before_filter :check_group_read_permissions, :only => :show

  def create
    build_resource
    @group.add_admin! current_user
    create!
  end

  # CUSTOM CONTROLLER ACTIONS

  def add_subgroup
    @parent = Group.find(params[:group_id])
    @subgroup = Group.new(:parent => @parent)
    @subgroup.viewable_by = @parent.viewable_by
    @subgroup.members_invitable_by = @parent.members_invitable_by
  end

  def invite_member
    @group = Group.find(params[:id])
    @user = User.new
  end

  def request_membership
    @group = Group.find(params[:id])
    @membership = Membership.new
  end

  def add_user_tag
    group = Group.find(params[:id])
    user = User.find(params[:user_id])
{'fraction_non_alphanumeric': 0.09096142774899252, 'fraction_numerical': 0.0, 'mean_word_length': 3.8547486033519553, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5090998', 'n_tokens_mistral': 571, 'n_tokens_neox': 549, 'n_words': 139}