petergate 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -4
- data/lib/petergate/version.rb +1 -1
- data/petergate.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f236f8cbe7b18b49b4714c5ba2dcc69a16c86cee
|
4
|
+
data.tar.gz: 0d9f8edc3828180ced8b268494cf19ee16cccb93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cce83ecc382e6f45da64df162528c74d9008661a9868fa06b2238928fc8c6e771e9d18da663912b1e4693dc0533cd34e2c530b05e56c31102bb46317eb24ea9
|
7
|
+
data.tar.gz: 9234a9af5dd5a36b7312b2e8da311a03e3bba35568c069fe2507ca9aaef3f612f60706230bf087f278651bd525e2bb995381331fea23c7cb14ba9db3cc482745
|
data/README.md
CHANGED
@@ -6,9 +6,7 @@ Simple User Authorizations.
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
|
10
|
-
gem 'petergate'
|
11
|
-
```
|
9
|
+
$ gem 'petergate'
|
12
10
|
|
13
11
|
And then execute:
|
14
12
|
|
@@ -22,10 +20,27 @@ Make sure you already have a User model setup. Works great with [devise](https:/
|
|
22
20
|
Run generator to install it.
|
23
21
|
|
24
22
|
$ rails g petergate:install
|
23
|
+
$ rake db:migrate
|
24
|
+
|
25
|
+
This will add:
|
26
|
+
```ruby
|
27
|
+
petergate(roles: [:admin])
|
28
|
+
```
|
29
|
+
to your gem file.
|
25
30
|
|
26
31
|
## Usage
|
27
32
|
|
28
|
-
|
33
|
+
Setup permissions in your controllers the same as you would for a before filter like so:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
access all: [:show, :index], user: AllRest
|
37
|
+
```
|
38
|
+
|
39
|
+
Inside your views you can use logged?(:admin, :customer) to show or hide content.
|
40
|
+
|
41
|
+
```erb
|
42
|
+
<%= link_to "destroy", destroy_listing_path(listing) if logged_in?(:admin) %>
|
43
|
+
```
|
29
44
|
|
30
45
|
## Contributing
|
31
46
|
|
data/lib/petergate/version.rb
CHANGED
data/petergate.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["isaac@isaacsloan.com"]
|
11
11
|
spec.summary = %q{Authorization system allowing verbose easy read controller syntax.}
|
12
12
|
spec.description = %q{Authorization system.}
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/isaacsloan/petergate"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petergate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Sloan
|
@@ -56,7 +56,7 @@ files:
|
|
56
56
|
- lib/petergate/railtie.rb
|
57
57
|
- lib/petergate/version.rb
|
58
58
|
- petergate.gemspec
|
59
|
-
homepage:
|
59
|
+
homepage: https://github.com/isaacsloan/petergate
|
60
60
|
licenses:
|
61
61
|
- MIT
|
62
62
|
metadata: {}
|