mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 13:19:19 +08:00
Previously, assignment permissions only came from the global `assign_allowed_on_groups` site setting. This change lets categories grant assignment permission to additional groups, keeping assignment controls and assignee suggestions scoped to the relevant category.
12 lines
374 B
Ruby
Vendored
12 lines
374 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module DiscourseAssignSpecHelpers
|
|
def allow_group_to_assign_in_category(category, group)
|
|
category.custom_fields[
|
|
DiscourseAssign::AssignmentPermissions::CATEGORY_ADDITIONAL_ASSIGN_ALLOWED_GROUPS
|
|
] = group.id.to_s
|
|
category.save_custom_fields
|
|
end
|
|
end
|
|
|
|
RSpec.configure { |config| config.include DiscourseAssignSpecHelpers }
|