Unverified Commit 13fb9faa authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

Fixed issue with LDAP role not being respected (#1728)

parent 737d39dc
...@@ -228,7 +228,7 @@ class SessionsController < ApplicationController ...@@ -228,7 +228,7 @@ class SessionsController < ApplicationController
send_invite_user_signup_email(user) if invite_registration && !@user_exists send_invite_user_signup_email(user) if invite_registration && !@user_exists
user.set_role :user unless @user_exists user.set_role :user if !@user_exists && user.role.nil?
login(user) login(user)
......
...@@ -63,7 +63,7 @@ module AuthValues ...@@ -63,7 +63,7 @@ module AuthValues
role_provider = auth['provider'] == "bn_launcher" ? auth['info']['customer'] : "greenlight" role_provider = auth['provider'] == "bn_launcher" ? auth['info']['customer'] : "greenlight"
roles.each do |role_name| roles.each do |role_name|
role = Role.find_by(provider: role_provider, name: role_name) role = Role.find_by(provider: role_provider, name: role_name)
user.role = role if !role.nil? && !user.has_role?(role_name) user.set_role(role_name) if !role.nil? && !user.has_role?(role_name)
end end
end end
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment