petergate 0.1.7 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 477d5115ba11244c1736a528c9e853ec9f1b9f56
4
- data.tar.gz: f75c1c312bc7ef5e18aee99cf83664348c5d2795
3
+ metadata.gz: f236f8cbe7b18b49b4714c5ba2dcc69a16c86cee
4
+ data.tar.gz: 0d9f8edc3828180ced8b268494cf19ee16cccb93
5
5
  SHA512:
6
- metadata.gz: 0f01776df6390edb2bfe35ed1f6a6bfef61eb495e530785091de0676c965f425033673004d2fd8707f019a7462b404ac8562a7246e03039340db9660ffacb06b
7
- data.tar.gz: a3a38fa8b950adb78f1d54ef5b66479c7af5456c7c7849e27cf24cc8bdcd4a2c83d1890f0d1cc891751b0f2292afd0ab44fb7fa91b9def712ae98e64e7b057ad
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
- ```ruby
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
- TODO: Write usage instructions here
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
 
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
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 = "http://RingSeven.com"
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.7
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: http://RingSeven.com
59
+ homepage: https://github.com/isaacsloan/petergate
60
60
  licenses:
61
61
  - MIT
62
62
  metadata: {}