forked from b-studios/discourse-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.rb
24 lines (19 loc) · 1.02 KB
/
plugin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# name: course
# about: A plugin to use Discourse as auth provider
# version: 0.0.2
# authors: Jonathan Brachthäuser
require_relative 'lib/course'
Discourse::Application.routes.append do
post '/admin/course/auth' => 'course/api#auth'
get '/admin/course/dump' => 'course/api#dump'
put '/admin/course/user_field' => 'course/api#set_user_field'
put '/admin/course/user_fields' => 'course/api#set_user_fields'
# Synchronize fields and groups for a single user for debugging,
# hence GET. Webhooks will use POST, to be handled by another method.
get '/admin/course/synchronize_user_fields_and_groups' => 'course/api#synchronize_user_fields_and_groups'
# Synchronize fields and groups for all users
get '/admin/course/synchronize_all_user_fields_and_groups' => 'course/api#synchronize_all_user_fields_and_groups'
# Give all users not subscribed to any lecture
# the group `SiteSetting.default_lecture_group`
get '/admin/course/add_people_to_default_lecture_group' => 'course/api#add_people_to_default_lecture_group'
end