adeia 0.14.0 → 0.15.0
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 +4 -4
- data/README.md +12 -8
- data/lib/adeia/controller_methods.rb +1 -0
- data/lib/adeia/helpers/user_helper.rb +4 -0
- data/lib/adeia/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: a93bd33dfa2aa6851e05d96b480b48aaf05a5ba4
|
|
4
|
+
data.tar.gz: 523e4a924d0ee0794ca1da1161d8f6fc45c4509b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba8ba952a5954bcfec327216f8f1cf99d1651fc0cd635321b96448b233f2fae569c2f07196928ac704d8f987184b08f9f252d8a42bbd58794e835cda9dcebcbf
|
|
7
|
+
data.tar.gz: c53e4b015e96531ef751ce4a686a00e91039f072d3737b908a4b7d38609d9afc35a865d9c4d3bf748d93c4982acdb15e5268b09cdc054e18931de901f6435e4b
|
data/README.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
An discretionary authorization gem for Rails that allows you to have the complete control of your app.
|
|
4
4
|
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
Requires a User model with:
|
|
8
|
+
|
|
9
|
+
* An method `name`, returning the name of the user.
|
|
10
|
+
* A column `remember_token`, containing a generated token used for the authentification.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
rails g model User name:string remember_token:string
|
|
14
|
+
```
|
|
15
|
+
|
|
5
16
|
## Installation
|
|
6
17
|
|
|
7
18
|
Add this line to your application's Gemfile:
|
|
@@ -41,13 +52,6 @@ rake adeia:permissions elements="admin/galleries, admin/articles, admin/categori
|
|
|
41
52
|
rake adeia:superuser user_id=59
|
|
42
53
|
```
|
|
43
54
|
|
|
44
|
-
## Requirements
|
|
45
|
-
|
|
46
|
-
Requires a User model with:
|
|
47
|
-
|
|
48
|
-
* An method `name`, returning the name of the user.
|
|
49
|
-
* A column `remember_token`, containing a generated token used for the authentification.
|
|
50
|
-
|
|
51
55
|
## Documentation
|
|
52
56
|
|
|
53
57
|
### Authentification
|
|
@@ -113,7 +117,7 @@ def index
|
|
|
113
117
|
end
|
|
114
118
|
```
|
|
115
119
|
|
|
116
|
-
By default,
|
|
120
|
+
By default, each method (except `require_login!`) uses the following parameters:
|
|
117
121
|
|
|
118
122
|
* controller: the controller's name
|
|
119
123
|
* action: the action's name
|
|
@@ -29,6 +29,10 @@ module Adeia
|
|
|
29
29
|
@groups ||= Adeia::Group.joins(:group_users).where(adeia_group_users: { user_id: self.id })
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
def belongs_to?(name)
|
|
33
|
+
Adeia::GroupUser.joins(:group).where(user_id: self.id, adeia_groups: { name: name }).exists?
|
|
34
|
+
end
|
|
35
|
+
|
|
32
36
|
end
|
|
33
37
|
end
|
|
34
38
|
end
|
data/lib/adeia/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: adeia
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- khcr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-03-
|
|
11
|
+
date: 2017-03-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|