初始化单点登录用户同步用户角色

This commit is contained in:
huang 2016-05-17 11:21:05 +08:00
parent 60b4639448
commit 4c066f9ad3
1 changed files with 3 additions and 1 deletions

View File

@ -27,8 +27,10 @@ class SsosController < ApplicationController
## 加入组织
@organization = Organization.find(82)
unless @organization.org_members.exists?(user_id: sso.user_id)
member = OrgMember.new(:user_id => sso.user_id)
member = OrgMember.create(:user_id => sso.user_id, :created_at => Time.now)
# member = OrgMember.new(:user_id => sso.user_id)
@organization.org_members << member
OrgMemberRole.create(:org_member_id => member.id, :role_id => 12)
end
## 选择性跳转