tkh_authentication 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.0.5
6
+
7
+ * Users controller has both an authenticate and an authenticate_with_admin before_filters
8
+
9
+
5
10
  ## 0.0.4
6
11
 
7
12
  * Added an install rake task to run the migration and locale generators
data/README.md CHANGED
@@ -48,13 +48,13 @@ To display the login information module anywhere in your views
48
48
 
49
49
  render 'shared/login_info'
50
50
 
51
- At this point the user only needs to be authenticated to access any area. We are coming up with an authorization solution as well. To restrict access to your controllers:
51
+ Ifo restrict access to your controllers to logged in users:
52
52
 
53
- before_filter :authenticate
53
+ before_filter :authenticate, except: 'show'
54
54
 
55
- If you want to restrict access to users whose admin boolean attribute is true
55
+ Additionally, if you want to restrict access to users whose admin boolean attribute is true, add this line just below the authenticate one.
56
56
 
57
- before_filter :authenticate_with_admin
57
+ before_filter :authenticate_with_admin, except: [ 'show', 'index' ]
58
58
 
59
59
 
60
60
  ## Contributing
@@ -1,5 +1,6 @@
1
1
  class UsersController < ApplicationController
2
2
 
3
+ before_filter :authenticate, only: 'index'
3
4
  before_filter :authenticate_with_admin, only: 'index'
4
5
 
5
6
  def index
@@ -17,7 +17,7 @@ module TkhAuthentication
17
17
 
18
18
  def copy_migrations
19
19
  puts 'creating user migration'
20
- migration_template "create_users.rb", "db/migrate/create_users2.rb"
20
+ migration_template "create_users.rb", "db/migrate/create_users.rb"
21
21
  end
22
22
 
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module TkhAuthentication
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -7,7 +7,7 @@ require 'tkh_authentication/tkh_authentication_helper'
7
7
 
8
8
  module TkhAuthentication
9
9
  class Engine < ::Rails::Engine
10
- # all this to extend the application_controller in the host app
10
+ # to extend the application helper in the host app
11
11
  initializer 'tkh_authentication.helper' do |app|
12
12
  ActionView::Base.send :include, TkhAuthenticationHelper
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -171,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  segments:
173
173
  - 0
174
- hash: -4440211809923125949
174
+ hash: -197654925651461113
175
175
  required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  none: false
177
177
  requirements:
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  segments:
182
182
  - 0
183
- hash: -4440211809923125949
183
+ hash: -197654925651461113
184
184
  requirements: []
185
185
  rubyforge_project:
186
186
  rubygems_version: 1.8.23