blaxter-lockdown 0.9.8.99 → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/lockdown.rb CHANGED
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), "lockdown", "helper")
3
3
  module Lockdown
4
4
  extend Lockdown::Helper
5
5
 
6
- VERSION = '0.9.8.99'
6
+ VERSION = '0.9.9'
7
7
 
8
8
  # Returns the version string for the library.
9
9
  def self.version
@@ -129,16 +129,22 @@ module Lockdown
129
129
  redirect_to(session[:prevpage])
130
130
  end
131
131
  end
132
-
132
+
133
133
  # Called from current_user. Now, attempt to login by
134
134
  # basic authentication information.
135
135
  def login_from_basic_auth?
136
136
  username, passwd = get_auth_data
137
137
  if username && passwd
138
- set_session_user ::User.authenticate(username, passwd)
138
+ add_lockdown_session_values ::User.authenticate(username, passwd)
139
+ @_logged_from_basic_auth = logged_in?
139
140
  end
140
141
  end
141
142
 
143
+ # Whether the login has been made through basic auth
144
+ def logged_from_basic_auth?
145
+ @_logged_from_basic_auth
146
+ end
147
+
142
148
  @@http_auth_headers = %w(X-HTTP_AUTHORIZATION HTTP_AUTHORIZATION Authorization)
143
149
  # gets BASIC auth info
144
150
  def get_auth_data
data/lockdown.gemspec ADDED
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{lockdown}
5
+ s.version = "0.9.9"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Andrew Stone"]
9
+ s.date = %q{2009-08-26}
10
+ s.description = %q{Lockdown is an authorization system for RubyOnRails (ver >= 2.1).}
11
+ s.email = %q{andy@stonean.com}
12
+ s.extra_rdoc_files = ["History.txt", "README.txt"]
13
+ s.files = ["History.txt", "README.txt", "Rakefile", "lib/lockdown.rb", "lib/lockdown/context.rb", "lib/lockdown/database.rb", "lib/lockdown/frameworks/rails.rb", "lib/lockdown/frameworks/rails/controller.rb", "lib/lockdown/frameworks/rails/view.rb", "lib/lockdown/helper.rb", "lib/lockdown/orms/active_record.rb", "lib/lockdown/permission.rb", "lib/lockdown/rules.rb", "lib/lockdown/session.rb", "lib/lockdown/system.rb", "lockdown.gemspec", "rails_generators/lockdown/lockdown_generator.rb", "rails_generators/lockdown/templates/app/controllers/permissions_controller.rb", "rails_generators/lockdown/templates/app/controllers/sessions_controller.rb", "rails_generators/lockdown/templates/app/controllers/user_groups_controller.rb", "rails_generators/lockdown/templates/app/controllers/users_controller.rb", "rails_generators/lockdown/templates/app/helpers/permissions_helper.rb", "rails_generators/lockdown/templates/app/helpers/user_groups_helper.rb", "rails_generators/lockdown/templates/app/helpers/users_helper.rb", "rails_generators/lockdown/templates/app/models/permission.rb", "rails_generators/lockdown/templates/app/models/profile.rb", "rails_generators/lockdown/templates/app/models/user.rb", "rails_generators/lockdown/templates/app/models/user_group.rb", "rails_generators/lockdown/templates/app/views/permissions/index.html.erb", "rails_generators/lockdown/templates/app/views/permissions/show.html.erb", "rails_generators/lockdown/templates/app/views/sessions/new.html.erb", "rails_generators/lockdown/templates/app/views/user_groups/edit.html.erb", "rails_generators/lockdown/templates/app/views/user_groups/index.html.erb", "rails_generators/lockdown/templates/app/views/user_groups/new.html.erb", "rails_generators/lockdown/templates/app/views/user_groups/show.html.erb", "rails_generators/lockdown/templates/app/views/users/edit.html.erb", "rails_generators/lockdown/templates/app/views/users/index.html.erb", "rails_generators/lockdown/templates/app/views/users/new.html.erb", "rails_generators/lockdown/templates/app/views/users/show.html.erb", "rails_generators/lockdown/templates/config/initializers/lockit.rb", "rails_generators/lockdown/templates/db/migrate/create_admin_user.rb", "rails_generators/lockdown/templates/db/migrate/create_permissions.rb", "rails_generators/lockdown/templates/db/migrate/create_profiles.rb", "rails_generators/lockdown/templates/db/migrate/create_user_groups.rb", "rails_generators/lockdown/templates/db/migrate/create_users.rb", "rails_generators/lockdown/templates/lib/lockdown/README", "rails_generators/lockdown/templates/lib/lockdown/init.rb", "spec/lockdown/database_spec.rb", "spec/lockdown/frameworks/rails/controller_spec.rb", "spec/lockdown/frameworks/rails/view_spec.rb", "spec/lockdown/frameworks/rails_spec.rb", "spec/lockdown/permission_spec.rb", "spec/lockdown/rules_spec.rb", "spec/lockdown/session_spec.rb", "spec/lockdown/system_spec.rb", "spec/lockdown_spec.rb", "spec/rcov.opts", "spec/spec.opts", "spec/spec_helper.rb"]
14
+ s.homepage = %q{http://stonean.com/wiki/lockdown}
15
+ s.rdoc_options = ["--main", "README.txt"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{lockdown}
18
+ s.rubygems_version = %q{1.3.3}
19
+ s.summary = %q{Lockdown is an authorization system for RubyOnRails (ver >= 2}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
+ s.add_development_dependency(%q<bones>, [">= 2.5.1"])
27
+ else
28
+ s.add_dependency(%q<bones>, [">= 2.5.1"])
29
+ end
30
+ else
31
+ s.add_dependency(%q<bones>, [">= 2.5.1"])
32
+ end
33
+ end
@@ -37,6 +37,8 @@
37
37
  # Will return true if the session[:access_rights] contain at
38
38
  # least one match to the access_right list associated to the group
39
39
  #
40
+ # logged_from_basic_auth?: whether the login process has been made by basic auth
41
+ #
40
42
  # If you want access to any of these methods in your view, just add them
41
43
  # as helpers in your controller (application controller for global use).
42
44
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blaxter-lockdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.99
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-04 00:00:00 -07:00
12
+ date: 2009-08-26 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -47,6 +47,7 @@ files:
47
47
  - lib/lockdown/rules.rb
48
48
  - lib/lockdown/session.rb
49
49
  - lib/lockdown/system.rb
50
+ - lockdown.gemspec
50
51
  - rails_generators/lockdown/lockdown_generator.rb
51
52
  - rails_generators/lockdown/templates/app/controllers/permissions_controller.rb
52
53
  - rails_generators/lockdown/templates/app/controllers/sessions_controller.rb