the_role 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -36,6 +36,20 @@ rake db:roles:test
36
36
  >> Administrator, Moderator of pages, User, Demo
37
37
  ```
38
38
 
39
+ Define alias method for **the_login_required** for correctly work of admin's controllers
40
+
41
+ **login_required** or any other method from your auth system
42
+
43
+ ``` ruby
44
+ class ApplicationController < ActionController::Base
45
+ # You Auth system
46
+ include AuthenticatedSystem
47
+
48
+ # TheRole login_required method alias
49
+ alias_method :the_login_required, :login_required
50
+ end
51
+ ```
52
+
39
53
  ## Manage roles
40
54
 
41
55
  ``` ruby
@@ -85,18 +99,4 @@ user.has_role? :any_crazy_name, :any_crazy_name
85
99
 
86
100
  ```
87
101
 
88
- ## Extend TheRole's controllers with **login_require** method
89
-
90
- **config/initialisers/the_role.rb**
91
-
92
- ``` ruby
93
- require 'authenticated_system'
94
-
95
- Admin::RolesController.send :include, AuthenticatedSystem
96
- Admin::RoleSectionController.send :include, AuthenticatedSystem
97
-
98
- Admin::RolesController.send :before_filter, :login_require
99
- Admin::RoleSectionController.send :before_filter, :login_require
100
- ```
101
-
102
102
  Copyright (c) 2011 [Ilya N. Zykin Github.com/the-teacher], released under the MIT license
@@ -1,4 +1,5 @@
1
1
  class Admin::RoleSectionController < ApplicationController
2
+ before_filter :login_required
2
3
  before_filter :the_role_require
3
4
  before_filter :find_role, :only=>[:destroy, :delete_policy]
4
5
  before_filter :the_owner_require, :only=>[:destroy, :delete_policy]
@@ -2,6 +2,7 @@ require 'the_role'
2
2
 
3
3
  class Admin::RolesController < ApplicationController
4
4
  layout 'the_role'
5
+ before_filter :the_login_required
5
6
  before_filter :the_role_require
6
7
  before_filter :find_role, :only => [:show, :edit, :update, :destroy, :new_role_section, :new_role_policy]
7
8
  before_filter :the_owner_require, :only => [:show, :edit, :update, :destroy, :new_role_section, :new_role_policy]
@@ -1,3 +1,3 @@
1
1
  module TheRole
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_role
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
16
- requirement: &81420680 !ruby/object:Gem::Requirement
16
+ requirement: &75812050 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *81420680
24
+ version_requirements: *75812050
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sass
27
- requirement: &81420470 !ruby/object:Gem::Requirement
27
+ requirement: &75811840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *81420470
35
+ version_requirements: *75811840
36
36
  description: TheRole - simple, but powerful role system for ROR applications
37
37
  email:
38
38
  - zykin-ilya@ya.ru