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 CHANGED
@@ -1,4 +1,4 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in the_role.gemspec
4
- gem 'slim'
4
+ gemspec
data/lib/tasks/roles.rake CHANGED
@@ -10,7 +10,7 @@ namespace :db do
10
10
  }
11
11
  }
12
12
  Role.new(
13
- :name => :administrator,
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 => :user,
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 => :user,
110
+ :name => :demo,
111
111
  :title => 'Demo',
112
112
  :description => "Demo user",
113
113
  :the_role => role.to_yaml
@@ -1,3 +1,3 @@
1
1
  module TheRole
2
- VERSION = "0.9.9"
2
+ VERSION = "0.9.91"
3
3
  end
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
- self.the_role[section.to_sym][policy.to_sym].is_a?(TrueClass) if self.the_role[section.to_sym] && self.the_role[section.to_sym][policy.to_sym]
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
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  # specify any dependencies here; for example:
22
22
  # s.add_development_dependency "rspec"
23
23
  # s.add_runtime_dependency "rest-client"
24
+ s.add_dependency 'haml'
24
25
  end
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.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