Merge branch 'master' into 'master'

Fix authorized bug.

See merge request spen/seminar!26
This commit is contained in:
chiu 2021-11-18 11:08:43 +00:00
commit 2160933f6c
1 changed files with 3 additions and 0 deletions

View File

@ -21,9 +21,12 @@ class Admin::SeminarsController < OrbitAdminController
end end
def check_manager_for_seminar def check_manager_for_seminar
OrbitHelper.set_params(params,current_user) OrbitHelper.set_params(params,current_user)
OrbitHelper.set_this_module_app("seminar")
access_level = OrbitHelper.user_access_level? access_level = OrbitHelper.user_access_level?
if (access_level.nil? || access_level == "user") && (@seminar.organizer_id != current_user.member_profile_id rescue true) if (access_level.nil? || access_level == "user") && (@seminar.organizer_id != current_user.member_profile_id rescue true)
render_401 render_401
elsif access_level == "sub_manager" && @seminar && !(OrbitHelper.user_can_edit(@seminar))
render_401
end end
end end
def check_permission_for_seminar def check_permission_for_seminar