the_role 0.9.9 → 0.9.91
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/lib/tasks/roles.rake +3 -3
- data/lib/the_role/version.rb +1 -1
- data/lib/the_role.rb +5 -1
- data/the_role.gemspec +1 -0
- metadata +13 -2
data/Gemfile
CHANGED
data/lib/tasks/roles.rake
CHANGED
@@ -10,7 +10,7 @@ namespace :db do
|
|
10
10
|
}
|
11
11
|
}
|
12
12
|
Role.new(
|
13
|
-
:name => :
|
13
|
+
:name => :admin,
|
14
14
|
:title => 'Administrator',
|
15
15
|
:description => 'Role for administrator',
|
16
16
|
:the_role => role.to_yaml
|
@@ -27,7 +27,7 @@ namespace :db do
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
Role.new(
|
30
|
-
:name => :
|
30
|
+
:name => :moderator,
|
31
31
|
:title => 'Moderator of pages',
|
32
32
|
:description => "Moderator #1",
|
33
33
|
:the_role => role.to_yaml
|
@@ -107,7 +107,7 @@ namespace :db do
|
|
107
107
|
}
|
108
108
|
}
|
109
109
|
Role.new(
|
110
|
-
:name => :
|
110
|
+
:name => :demo,
|
111
111
|
:title => 'Demo',
|
112
112
|
:description => "Demo user",
|
113
113
|
:the_role => role.to_yaml
|
data/lib/the_role/version.rb
CHANGED
data/lib/the_role.rb
CHANGED
@@ -47,7 +47,11 @@ module TheRole
|
|
47
47
|
def has_role?(section, policy)
|
48
48
|
return true if self.admin?
|
49
49
|
return true if self.moderator? section
|
50
|
-
|
50
|
+
if self.the_role[section.to_sym] && self.the_role[section.to_sym][policy.to_sym]
|
51
|
+
self.the_role[section.to_sym][policy.to_sym].is_a?(TrueClass)
|
52
|
+
else
|
53
|
+
false
|
54
|
+
end
|
51
55
|
end
|
52
56
|
|
53
57
|
# FALSE if object is nil
|
data/the_role.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_role
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.91
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,18 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2011-10-29 00:00:00.000000000Z
|
13
|
-
dependencies:
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: haml
|
16
|
+
requirement: &76871660 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *76871660
|
14
25
|
description: TheRole - simple, but powerful role system for ROR applications
|
15
26
|
email:
|
16
27
|
- zykin-ilya@ya.ru
|