Refactor authentication token for new study-group-based authorization
This commit is contained in:

committed by
Sebastian Serth

parent
cb1b163b30
commit
936c11e31f
@ -55,9 +55,10 @@ class SubscriptionsController < ApplicationController
|
||||
def subscription_params
|
||||
current_user_id = current_user.try(:id)
|
||||
current_user_class_name = current_user.try(:class).try(:name)
|
||||
study_group_id = current_user.try(:current_study_group_id)
|
||||
if params[:subscription].present?
|
||||
params[:subscription].permit(:request_for_comment_id, :subscription_type).merge(user_id: current_user_id,
|
||||
user_type: current_user_class_name, deleted: false)
|
||||
user_type: current_user_class_name, study_group_id: study_group_id, deleted: false)
|
||||
end
|
||||
end
|
||||
private :subscription_params
|
||||
|
Reference in New Issue
Block a user