Add admin and moderator state to sso provider

This commit is contained in:
Sam 2014-11-27 12:24:21 +11:00
parent f918d3e89b
commit 800ae5265f
2 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,8 @@ class SessionController < ApplicationController
sso.username = current_user.username
sso.email = current_user.email
sso.external_id = current_user.id.to_s
sso.admin = current_user.admin?
sso.moderator = current_user.moderator?
redirect_to sso.to_url(sso.return_sso_url)
else
session[:sso_payload] = request.query_string

View File

@ -1,6 +1,6 @@
class SingleSignOn
ACCESSORS = [:nonce, :name, :username, :email, :avatar_url, :avatar_force_update,
:about_me, :external_id, :return_sso_url]
:about_me, :external_id, :return_sso_url, :admin, :moderator]
FIXNUMS = []
NONCE_EXPIRY_TIME = 10.minutes