petergate 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/petergate/version.rb +1 -1
- data/lib/petergate.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c6bb01335ae726fb9111f4e67114216130876b2
|
4
|
+
data.tar.gz: ec55f513adceccfba351f00635895da22db55865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8e3d3549fd6985170c2385c951e9cb5a6229e4811ba5055f1a67704cf42a2f0b65e123a3b2501be502f17f8cb7d9480db95c4a8ac3cac886ab52b97b4db4c50
|
7
|
+
data.tar.gz: 106830457161d0832a1b518417fbf3bc9fb7037ee8f6b68bb015f7f137f1ac13476f193a87741811cd243f9136301df6185762b782caf518671810881deecce9
|
data/README.md
CHANGED
@@ -53,9 +53,9 @@ Usage
|
|
53
53
|
Setup permissions in your controllers the same as you would for a before filter like so:
|
54
54
|
|
55
55
|
```ruby
|
56
|
-
access all: [:show, :index], user:
|
56
|
+
access all: [:show, :index], user: {except: [:destroy]}, company_admin: :all
|
57
57
|
|
58
|
-
# one other
|
58
|
+
# one other option that might seem a bit weird is to put a group of roles in an array:
|
59
59
|
access [:all, :user] => [:show, :index]
|
60
60
|
```
|
61
61
|
|
data/lib/petergate/version.rb
CHANGED
data/lib/petergate.rb
CHANGED
@@ -5,9 +5,12 @@ module Petergate
|
|
5
5
|
module ControllerMethods
|
6
6
|
module ClassMethods
|
7
7
|
def const_missing(const_name)
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
if [:AllRest, :ALLREST].include?(const_name)
|
9
|
+
warn "`AllRest` and `ALLREST` has been deprecated. Use :all instead."
|
10
|
+
return ALLRESTDEP
|
11
|
+
else
|
12
|
+
return super
|
13
|
+
end
|
11
14
|
end
|
12
15
|
|
13
16
|
def all_actions
|
@@ -40,8 +43,7 @@ module Petergate
|
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
43
|
-
|
44
|
-
ALLREST = [:show, :index, :new, :edit, :update, :create, :destroy]
|
46
|
+
ALLRESTDEP = [:show, :index, :new, :edit, :update, :create, :destroy]
|
45
47
|
|
46
48
|
def self.included(base)
|
47
49
|
base.extend(ClassMethods)
|