petergate 1.6.8 → 1.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -3
- data/lib/petergate/active_record/base.rb +1 -1
- data/lib/petergate/version.rb +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: 6fbfe5d59028ab9f3a7c6a316749e418891fe828
|
4
|
+
data.tar.gz: 5f1dd98aaab461d6bad65f79309b7f781a96d179
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94052faaf85168e86dc4ce03a12ce99bb497f7f6dd394f866b0480bd8d321d4cad8eaac7d11544a27703226f778efc4996ead361349717f0845c751dcf82105b
|
7
|
+
data.tar.gz: c804f26772a9e6048767b20c049dd3aaf7456ca34d2f462643014fb0a53734faea146e8b4e083614e6c71b8b9d2c316c10f7c63ec574187d36782eb149c3494c
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ This will add a migration and insert petergate into your User model.
|
|
46
46
|
|
47
47
|
Usage
|
48
48
|
------
|
49
|
-
|
49
|
+
####User Model
|
50
50
|
|
51
51
|
Configure available roles by modifying this block at the top of your user.rb.
|
52
52
|
|
@@ -60,9 +60,20 @@ petergate(roles: [:admin, :editor], multiple: false)
|
|
60
60
|
############################################################################################
|
61
61
|
```
|
62
62
|
|
63
|
-
Instance
|
63
|
+
##### Instance Methods
|
64
64
|
|
65
|
-
|
65
|
+
```ruby
|
66
|
+
user.role => :editor
|
67
|
+
user.roles => [:editor, :user]
|
68
|
+
user.roles=(v) #sets roles
|
69
|
+
user.available_roles => [:admin, :editor]
|
70
|
+
user.has_roles?(:admin, :editors) # returns true if user is any of roles passed in as params.
|
71
|
+
```
|
72
|
+
##### Class Methods
|
73
|
+
|
74
|
+
`User.role_editors => #list of editors. Method is created for all roles. role_admins, role_teachers, etc.`
|
75
|
+
|
76
|
+
####Controllers
|
66
77
|
|
67
78
|
Setup permissions in your controllers the same as you would for a before filter like so:
|
68
79
|
|
data/lib/petergate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petergate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|