class ApplicationController < ActionController::Base
# 一般ユーザー権限の検証
def require_member
# Shibbolethの認証状態の確認
# このアクションが実行された時点で、Shibbolethのセッションは確立されています。
# 必要に応じてSPの返却したパラメータを参照して権限の確認等を行います。
# SPの返却したパラメータは、HTTP環境変数に追加されています。
unless /nii-member/ =~ request.env['eduPersonEntitlemententitlement']
# eduPersonEntitlement に既定の値が無ければ認証エラー
render :file => 'error/auth_error', :use_full_path => true, :status => 403
end
end
# 管理者ユーザー権限の検証
def require_admin
# Shibbolethの認証状態の確認
# このアクションが実行された時点で、Shibbolethのセッションは確立されています。
# 必要に応じてSPの返却したパラメータを参照して権限の確認等を行います。
# SPの返却したパラメータは、HTTP環境変数に追加されています。
unless /nii-admin/ =~ request.env['eduPersonEntitlemententitlement']
# eduPersonEntitlement に既定の値が無ければ認証エラー
render :file => 'error/auth_error', :use_full_path => true, :status => 403
end
end
end |