destiny-rails 0.0.4 → 0.0.5
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/app/models/concerns/destiny/user.rb +10 -2
- data/lib/destiny/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: 945bf7a270ea5a075b30ba21949fe542974a1a95
|
|
4
|
+
data.tar.gz: c7ea37a9d9c3834f2667284aa510e8a161e57629
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c884430013abaf6d27c4599194b33a58a66f291c46c0a4253391edc757fac58ea0953fc21b1bbb97a9a56af9ce9a386b7a87e23b4f5793365e582b7aeff709c
|
|
7
|
+
data.tar.gz: d9f256f154997e83d98ae22be1b59a5d70a76d110cadf196a2ab5cbff003dc3c4b8fc1299a81709a0451b91e268932f4e04eb5c46320b2997a49e49f32716971
|
|
@@ -8,8 +8,8 @@ module Destiny
|
|
|
8
8
|
|
|
9
9
|
def has_grant?(section_name, grant_name)
|
|
10
10
|
return true if is_admin?
|
|
11
|
-
return false unless
|
|
12
|
-
return false unless
|
|
11
|
+
return false unless role_hash[section_name]
|
|
12
|
+
return false unless role_hash[section_name].key? grant_name
|
|
13
13
|
|
|
14
14
|
role_hash[section_name][grant_name]
|
|
15
15
|
end
|
|
@@ -32,5 +32,13 @@ module Destiny
|
|
|
32
32
|
alias_method :admin?, :is_admin?
|
|
33
33
|
alias_method :has_role?, :has_grant?
|
|
34
34
|
|
|
35
|
+
module ClassMethods
|
|
36
|
+
|
|
37
|
+
def with_role(role_name)
|
|
38
|
+
Role.find_by_name(role_name).users
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
35
43
|
end
|
|
36
44
|
end
|
data/lib/destiny/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: destiny-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pavel Zhukov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-03-
|
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|