mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 08:56:36 +08:00
df3886d6e5
This commit introduces a new site setting "google_oauth2_hd_groups". If enabled, group information will be fetched from Google during authentication, and stored in the Discourse database. These 'associated groups' can be connected to a Discourse group via the "Membership" tab of the group preferences UI. The majority of the implementation is generic, so we will be able to add support to more authentication methods in the near future. https://meta.discourse.org/t/managing-group-membership-via-authentication/175950
14 lines
405 B
Ruby
14 lines
405 B
Ruby
# frozen_string_literal: true
|
|
class CreateUserAssociatedGroups < ActiveRecord::Migration[6.1]
|
|
def change
|
|
create_table :user_associated_groups do |t|
|
|
t.references :user, null: false
|
|
t.references :associated_group, null: false
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :user_associated_groups, %i[user_id associated_group_id], unique: true, name: 'index_user_associated_groups'
|
|
end
|
|
end
|