1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
# frozen_string_literal: true
module Groups
module Params
extend ActiveSupport::Concern
include DefaultBranchProtection
private
def group_params
normalize_default_branch_params!(:group)
params.require(:group).permit(group_params_attributes)
end
def group_params_attributes
[
:avatar,
:description,
:emails_disabled,
:emails_enabled,
:show_diff_preview_in_email,
:token_expiry_notify_inherited,
:mentions_disabled,
:lfs_enabled,
:name,
:path,
:public,
:request_access_enabled,
:share_with_group_lock,
:visibility_level,
:parent_id,
:create_chat_team,
:chat_team_name,
:require_two_factor_authentication,
:two_factor_grace_period,
:enabled_git_access_protocol,
:project_creation_level,
:subgroup_creation_level,
:default_branch_protection,
{ default_branch_protection_defaults: [
:allow_force_push,
:developer_can_initial_push,
:code_owner_approval_required,
{
allowed_to_merge: [:access_level],
allowed_to_push: [:access_level]
}
] },
:default_branch_name,
:allow_mfa_for_subgroups,
:remove_dormant_members,
:remove_dormant_members_period,
:resource_access_token_creation_allowed,
:prevent_sharing_groups_outside_hierarchy,
:setup_for_company,
:jobs_to_be_done,
:crm_enabled,
:crm_source_group_id,
:enable_namespace_descendants_cache
] + [group_feature_attributes: group_feature_attributes]
end
def group_feature_attributes
[]
end
end
end
Groups::Params.prepend_mod
|