ucb_rails_security 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -76,15 +76,15 @@ UCB::Rails::Security::ControllerMethods for other filter options.
76
76
  You can optionally generate scaffolding for a rudimentary administrative interface
77
77
  to manage users and roles within your rails application. To install the scaffolding:
78
78
 
79
- script/generate ucb_security
79
+ script/generate ucb_rails_security
80
80
 
81
81
  With the exception of the model classes (user, roles, ldap_search, user_roles),
82
- scaffolding is installed under the namespace ucb_security:
82
+ scaffolding is installed under the namespace ucb_rails_security:
83
83
 
84
- RAILS_ROOT/apps/controller/ucb_security
85
- RAILS_ROOT/apps/views/ucb_security
86
- RAILS_ROOT/apps/helpers/ucb_security
87
- RAILS_ROOT/public/stylesheets/ucb_security.css
84
+ RAILS_ROOT/apps/controller/ucb_rails_security
85
+ RAILS_ROOT/apps/views/ucb_rails_security
86
+ RAILS_ROOT/apps/helpers/ucb_rails_security
87
+ RAILS_ROOT/public/stylesheets/ucb_rails_security.css
88
88
  RAILS_ROOT/apps/models/{user.rb,role.rb,ldap_search.rb,user_roles.rb}
89
89
 
90
90
 
@@ -94,7 +94,7 @@ been generated, run the migration:
94
94
 
95
95
  rake db:migrate
96
96
 
97
- Finally, the ucb_security scaffolding adds custom routes to the top of
97
+ Finally, the ucb_rails_security scaffolding adds custom routes to the top of
98
98
  your route file. See <tt>RAILS_ROOT/config/routes.rb</tt> for more info on this.
99
99
 
100
100
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake'
3
3
  require 'echoe'
4
4
  require 'hanna/rdoctask'
5
5
 
6
- Echoe.new('ucb_rails_security', '2.1.0') do |p|
6
+ Echoe.new('ucb_rails_security', '2.1.1') do |p|
7
7
  p.description = "Simplifies CAS auth and ldap authz within your rails application"
8
8
  p.url = "http://ucbrb.rubyforge.org/ucb_rails_security"
9
9
  p.author = "Steven Hansen, Steven Downey"
@@ -81,6 +81,7 @@ module UCB
81
81
  user = yield()
82
82
  login_user(user)
83
83
  grant_roles_to_user(user, roles)
84
+ user
84
85
  end
85
86
 
86
87
  # Logs in a given user to the application:
@@ -88,7 +89,7 @@ module UCB
88
89
  # user = User.create!(:ldap_uid => "666", :first_name => "first_name", :last_name => "last_name")
89
90
  # login_user(user)
90
91
  #
91
- def login_user(user)
92
+ def login_user(user, &block)
92
93
  user = yield() if block_given?
93
94
  raise(Exception, "login_user() expects user object as argument or return value of a block") if user.nil?
94
95
  UCB::Rails::Security::CASAuthentication.force_login_filter_true_for = user.ldap_uid
@@ -101,6 +102,7 @@ module UCB
101
102
  controller().send(:ldap_user=, mock_ldap_person)
102
103
  controller().send(:user_table_id=, user.id)
103
104
  controller().send(:user_table_user=, user)
105
+ user
104
106
  end
105
107
 
106
108
  # Gives the uesrs instance the specified roles:
@@ -110,9 +112,10 @@ module UCB
110
112
  def grant_roles_to_user(user, r_names)
111
113
  roles = r_names.map { |r| Role.new(:name => r) }
112
114
  user.stub!(:roles).and_return(roles)
115
+ user
113
116
  end
114
117
 
115
118
  end
116
119
  end
117
120
  end
118
- end
121
+ end
@@ -7,9 +7,9 @@ require 'rubycas-client'
7
7
  require 'casclient'
8
8
  require 'casclient/frameworks/rails/filter'
9
9
 
10
- require 'ucb_ldap'
11
10
  require 'ucb_ldap'
12
11
 
12
+ require 'helpers/rspec_helpers'
13
13
  require 'ucb_rails_security_casauthentication'
14
14
  require 'ucb_rs_controller_methods'
15
15
  require 'ucb_rails_security_logger'
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ucb_rails_security}
5
- s.version = "2.1.0"
5
+ s.version = "2.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Steven Hansen, Steven Downey"]
9
- s.date = %q{2008-12-18}
9
+ s.date = %q{2009-03-24}
10
10
  s.description = %q{Simplifies CAS auth and ldap authz within your rails application}
11
11
  s.email = %q{runner@berkeley.edu}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "README", "lib/helpers/rspec_helpers.rb", "lib/ucb_rails_security.rb", "lib/ucb_rails_security_casauthentication.rb", "lib/ucb_rails_security_logger.rb", "lib/ucb_rs_controller_methods.rb", "rdoc_includes/application_controller_rb.txt"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucb_rails_security
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Hansen, Steven Downey
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-18 00:00:00 -08:00
12
+ date: 2009-03-24 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency