CE changes for SSO web enforcement
Adds two methods for us to extend in EE: - OmniauthCallbacksController#link_identity - GroupPolicy#lookup_access_level!
This commit is contained in:
parent
8b55b794cb
commit
651cfd08ab
|
|
@ -86,7 +86,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|||
log_audit_event(current_user, with: oauth['provider'])
|
||||
|
||||
identity_linker ||= auth_module::IdentityLinker.new(current_user, oauth)
|
||||
identity_linker.link
|
||||
|
||||
link_identity(identity_linker)
|
||||
|
||||
if identity_linker.changed?
|
||||
redirect_identity_linked
|
||||
|
|
@ -100,6 +101,10 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|||
end
|
||||
end
|
||||
|
||||
def link_identity(identity_linker)
|
||||
identity_linker.link
|
||||
end
|
||||
|
||||
def redirect_identity_exists
|
||||
redirect_to after_sign_in_path_for(current_user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -129,6 +129,10 @@ class GroupPolicy < BasePolicy
|
|||
def access_level
|
||||
return GroupMember::NO_ACCESS if @user.nil?
|
||||
|
||||
@access_level ||= @subject.max_member_access_for_user(@user)
|
||||
@access_level ||= lookup_access_level!
|
||||
end
|
||||
|
||||
def lookup_access_level!
|
||||
@subject.max_member_access_for_user(@user)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue