Moin
12월 16, 2024, 9:03오후
1
moderators manage categories and groups가 활성화되면, модератор들은 자동 그룹에서 관리 탭을 볼 수 있습니다. 또한 카테고리 및 태그 추적 기본값을 편집하는 옵션을 열 수도 있습니다. 그러나 관리자가 추가한 카테고리나 태그는 그들에게 표시되지 않습니다. 추가로, 인터페이스에서 카테고리와 태그를 추가하고 저장할 수는 있지만, 변경 사항이 저장되지 않습니다. 저장이 실패했다는 오류 메시지도 없습니다.
자동 그룹에서 추적 기본값을 편집하는 것이 модератор들에게 허용되지 않는 이유는 무엇인가요?
end
def update
group = Group.find(params[:id])
guardian.ensure_can_edit!(group) if !guardian.can_admin_group?(group)
group_attributes = group_params(automatic: group.automatic)
reset_group_email_settings_if_disabled!(group, group_attributes)
categories, tags = []
if !group.automatic || current_user.admin
notification_level, categories, tags = user_default_notifications(group, group_attributes)
if params[:update_existing_users].blank?
user_count = count_existing_users(group.group_users, notification_level, categories, tags)
if user_count > 0
return(
render status: 422,
json: {
user_count: user_count,
errors: [I18n.t("invalid_params", message: :update_existing_users)],
:grant_trust_level,
:automatic_membership_email_domains,
:publish_read_state,
:allow_unknown_sender_topic_replies,
)
custom_fields = DiscoursePluginRegistry.editable_group_custom_fields
attributes << { custom_fields: custom_fields } if custom_fields.present?
end
if !automatic || current_user.admin
%i[muted regular tracking watching watching_first_post].each do |level|
attributes << { "#{level}_category_ids" => [] }
attributes << { "#{level}_tags" => [] }
end
end
attributes << { associated_group_ids: [] } if guardian.can_associate_groups?
attributes.concat(DiscoursePluginRegistry.group_params)
params.require(:group).permit(*attributes)
2개의 좋아요