DeRose Connect Client
Rails gem for interaction with DeRose Connect
Dependencies
(sudo) gem install echoe
(sudo) gem install rubycas-client
Installation
git clone [email protected]:dwaynemac/drc_client.git
cd drc_client
rake manifest
(sudo) rake install
Usage
Environement.rb
config.gem “drc_client”
DRCClient.configure(:base_url => “url-to-drc-server”)
ApplicationController
include DRCClient::HelperMethods
Filtering access
Just write in your controllers (ApplicationController if filtering full application)
before_filter DRCClient.filter(*options)
# TODO a filter that considers both drc_logged_in? and drc_user_allowed?
Options
:gateway
- if set true, DRC-connection won’t be mandatory.
:enable_single_sign_out
- if set true, when logged out from DRC you’ll be logout from the application as well. REQUIRES: config.action_controller.session_store = :active_record_store in environment and disabling forgery_protection
:user_model
- name of your user model, defaults to User
:drc_user_column
- name of the column of your user model that identifies its DRC user, defaults to drc_user
:local_user_id_column
- if your user model doesn’t have an :id attribute set it’s id_attribute_name here.
:require_local_user
- set this true if you users need a local_user on top of a DRC user. (if true set :user_model) DRCClient.filter WON’T CHECK THIS, USER drc_user_allowed?
:require_access_level
- not implemented yet - define access level needed to access your app. (:none, :student, :teacher, :director)
OTher DRCClient Methods
logout
- destroys session and logs user out of DRCServer
Helpers Available with DRCClient::HelperMethods
current_drc_user
logged_in_drc?
drc_login_url
logout_drc
get_local_user_id
drc_user_has_local_user?
…