vigilante 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +5 -13
  2. data/Gemfile +5 -7
  3. data/Gemfile.lock +110 -91
  4. data/VERSION +1 -1
  5. data/{lib/db/migrate/20101028091755_create_permissions.rb → db/migrate/20150609151817_create_permissions.rb} +2 -6
  6. data/{lib/generators/vigilante/install/templates/create_abilities.rb → db/migrate/20150609151836_create_abilities.rb} +5 -7
  7. data/db/migrate/20150609151845_create_ability_permissions.rb +10 -0
  8. data/db/migrate/20150609152056_create_authorizations.rb +10 -0
  9. data/db/migrate/20150609152444_create_authorization_extents.rb +11 -0
  10. data/lib/generators/vigilante/install/install_generator.rb +0 -23
  11. data/lib/vigilante/watched_operator.rb +1 -1
  12. data/lib/vigilante.rb +8 -0
  13. data/spec/dummy/db/seeds/initial_watchman_permissions.rb +8 -8
  14. data/spec/models/authorization_spec.rb +1 -1
  15. data/spec/spec_helper.rb +1 -2
  16. data/vigilante.gemspec +15 -23
  17. metadata +22 -30
  18. data/lib/db/migrate/20101028091859_create_abilities.rb +0 -14
  19. data/lib/db/migrate/20101028091927_create_ability_permissions.rb +0 -14
  20. data/lib/db/migrate/20101028092014_create_authorizations.rb +0 -16
  21. data/lib/db/migrate/20101124131334_add_extent_flag_to_ability.rb +0 -9
  22. data/lib/db/migrate/20101129084538_add_authorization_extent.rb +0 -15
  23. data/lib/db/migrate/20101129084620_remove_extent_from_authorization.rb +0 -11
  24. data/lib/db/migrate/20130829160700_add_importance_to_abilities.rb +0 -7
  25. data/lib/generators/vigilante/install/templates/create_ability_permissions.rb +0 -14
  26. data/lib/generators/vigilante/install/templates/create_authorization_extents.rb +0 -15
  27. data/lib/generators/vigilante/install/templates/create_authorizations.rb +0 -13
  28. data/lib/generators/vigilante/install/templates/create_permissions.rb +0 -13
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YTFlNzRjZTM0MDcxNjlhMzM5ZjIyNjUyZjhkZDM3MWM1ZmUwM2Q2NA==
5
- data.tar.gz: !binary |-
6
- MTE2ZmNjNDdkODYyODkzMDY4ZDc5ZjZhNzUzZWYxNmM1NmExNDcyNw==
2
+ SHA1:
3
+ metadata.gz: f69cabfdc29648468d44e85a4452a3c82c4ff024
4
+ data.tar.gz: 8a754afe21479b34e05180a54a3caede5c58b0f7
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NjZmYmUwZjgyNzA4NjQ0MmQ5YjRmNWE4MTA2Mzg2YzY4Y2Y3YmVlOWRlNzUz
10
- YzI3MGIwN2Y3MTY0NTAxMWRjNTUwN2MxZDBmMDM2OTFkY2RiNDlkZmQ5Zjkx
11
- YmExZDgxYmY4MjU5YTA5MzViMDAwYzNkODcxODU3MTgxMWE0MzQ=
12
- data.tar.gz: !binary |-
13
- YjIxMzliZjQ1MWNiMzk1ZTVkYTY2YzFiYzI0MDdlZDU0NWEzOWJhMTg5MjRi
14
- NWU5OWI3OTQ5YWJlMDI5Mjk1OWFiZTgzOGFhYWQ4NjQ4NzcwZjU4YTQ5Njhm
15
- ZmZmNmQ2NTBhZDk1MzZhYWU1Njg4OTM5Yjg3YTAwNjU3YjM1NjU=
6
+ metadata.gz: 729e189211a33f6454002072d14de126b0b42260d522b82608eaf1bcc6e55e9ed84fb1ccaa8fe235747245bfbe4e9cb61ba098602d9ac1b1b0fa39458bdbc7c8
7
+ data.tar.gz: c2fd7e79b39566351ba115c94fa1e77f87fec796bb6311109ad0d205a41b2be5ae664116b247d436e6febf0fce086194e01c4d475f6b8071e56e09985ca3ae6a
data/Gemfile CHANGED
@@ -1,20 +1,18 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rails", ">= 3.0.3"
3
+ gem "rails", ">= 4.0.0"
4
4
 
5
5
  group :development, :test do
6
6
  gem "jeweler"
7
- gem "rspec-rails", ">= 2.4.0"
7
+ gem "rspec-rails", "~> 2.14.0"
8
8
  end
9
9
 
10
10
 
11
11
  # test-environment gems
12
12
  group :test, :spec, :cucumber do
13
- gem 'sqlite3-ruby', :require => 'sqlite3' # needed for the rails-3-app : not really needed, but not sure how to avoid it
14
- gem "rspec", ">= 2.4.0"
15
- gem "remarkable", ">=4.0.0.alpha4"
16
- gem "remarkable_activemodel", ">=4.0.0.alpha4"
17
- gem "remarkable_activerecord", ">=4.0.0.alpha4"
13
+ gem 'sqlite3'
14
+ gem "rspec", "~> 2.14.0"
15
+ gem "shoulda-matchers"
18
16
  # gem "capybara"
19
17
  # gem "cucumber"
20
18
  # gem "database_cleaner"
data/Gemfile.lock CHANGED
@@ -1,41 +1,48 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- abstract (1.0.0)
5
- actionmailer (3.0.3)
6
- actionpack (= 3.0.3)
7
- mail (~> 2.2.9)
8
- actionpack (3.0.3)
9
- activemodel (= 3.0.3)
10
- activesupport (= 3.0.3)
11
- builder (~> 2.1.2)
12
- erubis (~> 2.6.6)
13
- i18n (~> 0.4)
14
- rack (~> 1.2.1)
15
- rack-mount (~> 0.6.13)
16
- rack-test (~> 0.5.6)
17
- tzinfo (~> 0.3.23)
18
- activemodel (3.0.3)
19
- activesupport (= 3.0.3)
20
- builder (~> 2.1.2)
21
- i18n (~> 0.4)
22
- activerecord (3.0.3)
23
- activemodel (= 3.0.3)
24
- activesupport (= 3.0.3)
25
- arel (~> 2.0.2)
26
- tzinfo (~> 0.3.23)
27
- activeresource (3.0.3)
28
- activemodel (= 3.0.3)
29
- activesupport (= 3.0.3)
30
- activesupport (3.0.3)
4
+ actionmailer (4.2.1)
5
+ actionpack (= 4.2.1)
6
+ actionview (= 4.2.1)
7
+ activejob (= 4.2.1)
8
+ mail (~> 2.5, >= 2.5.4)
9
+ rails-dom-testing (~> 1.0, >= 1.0.5)
10
+ actionpack (4.2.1)
11
+ actionview (= 4.2.1)
12
+ activesupport (= 4.2.1)
13
+ rack (~> 1.6)
14
+ rack-test (~> 0.6.2)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
17
+ actionview (4.2.1)
18
+ activesupport (= 4.2.1)
19
+ builder (~> 3.1)
20
+ erubis (~> 2.7.0)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
23
+ activejob (4.2.1)
24
+ activesupport (= 4.2.1)
25
+ globalid (>= 0.3.0)
26
+ activemodel (4.2.1)
27
+ activesupport (= 4.2.1)
28
+ builder (~> 3.1)
29
+ activerecord (4.2.1)
30
+ activemodel (= 4.2.1)
31
+ activesupport (= 4.2.1)
32
+ arel (~> 6.0)
33
+ activesupport (4.2.1)
34
+ i18n (~> 0.7)
35
+ json (~> 1.7, >= 1.7.7)
36
+ minitest (~> 5.1)
37
+ thread_safe (~> 0.3, >= 0.3.4)
38
+ tzinfo (~> 1.1)
31
39
  addressable (2.3.6)
32
- arel (2.0.6)
33
- builder (2.1.2)
40
+ arel (6.0.0)
41
+ builder (3.2.2)
34
42
  descendants_tracker (0.0.4)
35
43
  thread_safe (~> 0.3, >= 0.3.1)
36
- diff-lcs (1.1.2)
37
- erubis (2.6.6)
38
- abstract (>= 1.0.0)
44
+ diff-lcs (1.2.5)
45
+ erubis (2.7.0)
39
46
  faraday (0.9.0)
40
47
  multipart-post (>= 1.2, < 3)
41
48
  git (1.2.6)
@@ -47,9 +54,11 @@ GEM
47
54
  multi_json (>= 1.7.5, < 2.0)
48
55
  nokogiri (~> 1.6.0)
49
56
  oauth2
57
+ globalid (0.3.5)
58
+ activesupport (>= 4.1.0)
50
59
  hashie (3.0.0)
51
60
  highline (1.6.21)
52
- i18n (0.5.0)
61
+ i18n (0.7.0)
53
62
  jeweler (2.0.1)
54
63
  builder
55
64
  bundler (>= 1.0)
@@ -61,13 +70,13 @@ GEM
61
70
  rdoc
62
71
  json (1.8.1)
63
72
  jwt (1.0.0)
64
- mail (2.2.14)
65
- activesupport (>= 2.3.6)
66
- i18n (>= 0.4.0)
67
- mime-types (~> 1.16)
68
- treetop (~> 1.4.8)
69
- mime-types (1.16)
73
+ loofah (2.0.2)
74
+ nokogiri (>= 1.5.9)
75
+ mail (2.6.3)
76
+ mime-types (>= 1.16, < 3)
77
+ mime-types (2.6.1)
70
78
  mini_portile (0.6.0)
79
+ minitest (5.7.0)
71
80
  multi_json (1.10.1)
72
81
  multi_xml (0.5.5)
73
82
  multipart-post (2.0.0)
@@ -79,66 +88,76 @@ GEM
79
88
  multi_json (~> 1.3)
80
89
  multi_xml (~> 0.5)
81
90
  rack (~> 1.2)
82
- polyglot (0.3.1)
83
- rack (1.2.1)
84
- rack-mount (0.6.13)
85
- rack (>= 1.0.0)
86
- rack-test (0.5.7)
91
+ rack (1.6.1)
92
+ rack-test (0.6.3)
87
93
  rack (>= 1.0)
88
- rails (3.0.3)
89
- actionmailer (= 3.0.3)
90
- actionpack (= 3.0.3)
91
- activerecord (= 3.0.3)
92
- activeresource (= 3.0.3)
93
- activesupport (= 3.0.3)
94
- bundler (~> 1.0)
95
- railties (= 3.0.3)
96
- railties (3.0.3)
97
- actionpack (= 3.0.3)
98
- activesupport (= 3.0.3)
94
+ rails (4.2.1)
95
+ actionmailer (= 4.2.1)
96
+ actionpack (= 4.2.1)
97
+ actionview (= 4.2.1)
98
+ activejob (= 4.2.1)
99
+ activemodel (= 4.2.1)
100
+ activerecord (= 4.2.1)
101
+ activesupport (= 4.2.1)
102
+ bundler (>= 1.3.0, < 2.0)
103
+ railties (= 4.2.1)
104
+ sprockets-rails
105
+ rails-deprecated_sanitizer (1.0.3)
106
+ activesupport (>= 4.2.0.alpha)
107
+ rails-dom-testing (1.0.6)
108
+ activesupport (>= 4.2.0.beta, < 5.0)
109
+ nokogiri (~> 1.6.0)
110
+ rails-deprecated_sanitizer (>= 1.0.1)
111
+ rails-html-sanitizer (1.0.2)
112
+ loofah (~> 2.0)
113
+ railties (4.2.1)
114
+ actionpack (= 4.2.1)
115
+ activesupport (= 4.2.1)
99
116
  rake (>= 0.8.7)
100
- thor (~> 0.14.4)
101
- rake (10.3.2)
117
+ thor (>= 0.18.1, < 2.0)
118
+ rake (10.4.2)
102
119
  rdoc (4.1.1)
103
120
  json (~> 1.4)
104
- remarkable (4.0.0.alpha4)
105
- rspec (>= 2.0.0.alpha11)
106
- remarkable_activemodel (4.0.0.alpha4)
107
- remarkable (~> 4.0.0.alpha4)
108
- rspec (>= 2.0.0.alpha11)
109
- remarkable_activerecord (4.0.0.alpha4)
110
- remarkable (~> 4.0.0.alpha4)
111
- remarkable_activemodel (~> 4.0.0.alpha4)
112
- rspec (>= 2.0.0.alpha11)
113
- rspec (2.4.0)
114
- rspec-core (~> 2.4.0)
115
- rspec-expectations (~> 2.4.0)
116
- rspec-mocks (~> 2.4.0)
117
- rspec-core (2.4.0)
118
- rspec-expectations (2.4.0)
119
- diff-lcs (~> 1.1.2)
120
- rspec-mocks (2.4.0)
121
- rspec-rails (2.4.1)
122
- actionpack (~> 3.0)
123
- activesupport (~> 3.0)
124
- railties (~> 3.0)
125
- rspec (~> 2.4.0)
126
- sqlite3-ruby (1.3.2)
127
- thor (0.14.6)
121
+ rspec (2.14.1)
122
+ rspec-core (~> 2.14.0)
123
+ rspec-expectations (~> 2.14.0)
124
+ rspec-mocks (~> 2.14.0)
125
+ rspec-core (2.14.8)
126
+ rspec-expectations (2.14.5)
127
+ diff-lcs (>= 1.1.3, < 2.0)
128
+ rspec-mocks (2.14.6)
129
+ rspec-rails (2.14.2)
130
+ actionpack (>= 3.0)
131
+ activemodel (>= 3.0)
132
+ activesupport (>= 3.0)
133
+ railties (>= 3.0)
134
+ rspec-core (~> 2.14.0)
135
+ rspec-expectations (~> 2.14.0)
136
+ rspec-mocks (~> 2.14.0)
137
+ shoulda-matchers (2.8.0)
138
+ activesupport (>= 3.0.0)
139
+ sprockets (3.2.0)
140
+ rack (~> 1.0)
141
+ sprockets-rails (2.3.1)
142
+ actionpack (>= 3.0)
143
+ activesupport (>= 3.0)
144
+ sprockets (>= 2.8, < 4.0)
145
+ sqlite3 (1.3.10)
146
+ thor (0.19.1)
128
147
  thread_safe (0.3.4)
129
- treetop (1.4.9)
130
- polyglot (>= 0.3.1)
131
- tzinfo (0.3.23)
148
+ tzinfo (1.2.2)
149
+ thread_safe (~> 0.1)
132
150
 
133
151
  PLATFORMS
134
152
  ruby
135
153
 
136
154
  DEPENDENCIES
137
155
  jeweler
138
- rails (>= 3.0.3)
139
- remarkable (>= 4.0.0.alpha4)
140
- remarkable_activemodel (>= 4.0.0.alpha4)
141
- remarkable_activerecord (>= 4.0.0.alpha4)
142
- rspec (>= 2.4.0)
143
- rspec-rails (>= 2.4.0)
144
- sqlite3-ruby
156
+ rails (>= 4.0.0)
157
+ rspec (~> 2.14.0)
158
+ rspec-rails (~> 2.14.0)
159
+ shoulda-matchers
160
+ sqlite3
161
+
162
+ BUNDLED WITH
163
+ 1.10.3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -1,13 +1,9 @@
1
1
  class CreatePermissions < ActiveRecord::Migration
2
- def self.up
2
+ def change
3
3
  create_table :permissions do |t|
4
4
  t.string :allowed_action
5
5
 
6
- t.timestamps
6
+ t.timestamps null: false
7
7
  end
8
8
  end
9
-
10
- def self.down
11
- drop_table :permissions
12
- end
13
9
  end
@@ -1,14 +1,12 @@
1
1
  class CreateAbilities < ActiveRecord::Migration
2
- def self.up
2
+ def change
3
3
  create_table :abilities do |t|
4
4
  t.string :name
5
5
  t.string :description
6
- t.boolean :needs_extent
7
- t.timestamps
8
- end
9
- end
6
+ t.boolean :needs_extent
7
+ t.integer :importance
10
8
 
11
- def self.down
12
- drop_table :abilities
9
+ t.timestamps null: false
10
+ end
13
11
  end
14
12
  end
@@ -0,0 +1,10 @@
1
+ class CreateAbilityPermissions < ActiveRecord::Migration
2
+ def change
3
+ create_table :ability_permissions do |t|
4
+ t.references :ability
5
+ t.references :permission
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ class CreateAuthorizations < ActiveRecord::Migration
2
+ def change
3
+ create_table :authorizations do |t|
4
+ t.references :operator, references: false
5
+ t.references :ability
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class CreateAuthorizationExtents < ActiveRecord::Migration
2
+ def change
3
+ create_table :authorization_extents do |t|
4
+ t.references :authorization
5
+ t.string :extent_type
6
+ t.integer :extent_objid
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -1,9 +1,6 @@
1
- require 'rails/generators/migration'
2
-
3
1
  module Vigilante
4
2
  module Generators
5
3
  class InstallGenerator < ::Rails::Generators::Base
6
- include Rails::Generators::Migration
7
4
  source_root File.expand_path('../templates', __FILE__)
8
5
  desc "This generator installs the default config file, and glue code into application-controller; which you can edit"
9
6
 
@@ -81,26 +78,6 @@ module Vigilante
81
78
  CODE
82
79
  end
83
80
  end
84
-
85
- def self.next_migration_number(path)
86
- unless @prev_migration_nr
87
- @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
88
- else
89
- @prev_migration_nr += 1
90
- end
91
- @prev_migration_nr.to_s
92
- end
93
-
94
- def copy_migrations
95
- migration_template "create_permissions.rb", "db/migrate/create_permissions.rb"
96
- migration_template "create_abilities.rb", "db/migrate/create_abilities.rb"
97
- migration_template "create_ability_permissions.rb", "db/migrate/create_ability_permissions.rb"
98
- migration_template "create_authorizations.rb", "db/migrate/create_authorizations.rb"
99
- migration_template "create_authorization_extents.rb", "db/migrate/create_authorization_extents.rb"
100
- migration_template "add_extent_flag_to_ability.rb", "db/migrate/add_extent_flag_to_ability.rb"
101
- migration_template "add_importance_to_abilities.rb", "db/migrate/add_importance_to_abilities.rb"
102
- end
103
-
104
81
  end
105
82
  end
106
83
  end
@@ -6,7 +6,7 @@ module Vigilante
6
6
  base.has_many :abilities, :through => :authorizations
7
7
 
8
8
  base.accepts_nested_attributes_for :authorizations, :reject_if => proc {|x| x[:ability_id].blank?}, :allow_destroy => true
9
- base.attr_accessible :authorizations_attributes
9
+ base.attr_accessible :authorizations_attributes if base.respond_to?(:attr_accessible)
10
10
  end
11
11
 
12
12
  def add_authorization(role, extent=nil)
data/lib/vigilante.rb CHANGED
@@ -43,5 +43,13 @@ module Vigilante
43
43
  end
44
44
  end
45
45
 
46
+ initializer :append_migrations do |app|
47
+ unless app.root.to_s.match root.to_s
48
+ config.paths["db/migrate"].expanded.each do |expanded_path|
49
+ app.config.paths["db/migrate"] << expanded_path
50
+ end
51
+ end
52
+ end
53
+
46
54
  end
47
55
  end
@@ -1,25 +1,25 @@
1
1
 
2
2
 
3
- perm_allowed_all = Permission.find_or_create_by_allowed_action('*[all]')
4
- perm_read_all = Permission.find_or_create_by_allowed_action('*[index,show]')
5
- perm_blog_all = Permission.find_or_create_by_allowed_action('blogs[all]')
6
- perm_blog_read = Permission.find_or_create_by_allowed_action('blogs[index,show]')
3
+ perm_allowed_all = Permission.where(allowed_action: '*[all]').first_or_create
4
+ perm_read_all = Permission.where(allowed_action: '*[index,show]').first_or_create
5
+ perm_blog_all = Permission.where(allowed_action: 'blogs[all]').first_or_create
6
+ perm_blog_read = Permission.where(allowed_action: 'blogs[index,show]').first_or_create
7
7
 
8
- ab_all = Ability.find_or_create_by_name(:name => 'can-manage-all') do |ab|
8
+ ab_all = Ability.where(name: 'can-manage-all').first_or_create do |ab|
9
9
  ab.permissions << perm_allowed_all
10
10
  end
11
11
 
12
- ab_read_all = Ability.find_or_create_by_name(:name => 'can-read-all') do |ab|
12
+ ab_read_all = Ability.where(name: 'can-read-all').first_or_create do |ab|
13
13
  ab.permissions << perm_read_all
14
14
  end
15
15
 
16
- ab_blog_all = Ability.find_or_create_by_name(:name => 'can-manage-blogs') do |ab|
16
+ ab_blog_all = Ability.where(name: 'can-manage-blogs').first_or_create do |ab|
17
17
  ab.permissions << perm_blog_all
18
18
  end
19
19
  ab_blog_all.update_attribute(:needs_extent, true)
20
20
 
21
21
 
22
- ab_blog_read = Ability.find_or_create_by_name(:name => 'can-see-blogs') do |ab|
22
+ ab_blog_read = Ability.where(name: 'can-see-blogs').first_or_create do |ab|
23
23
  ab.permissions << perm_blog_read
24
24
  end
25
25
  ab_blog_read.update_attribute(:needs_extent, true)
@@ -14,7 +14,7 @@ end
14
14
 
15
15
 
16
16
  describe Authorization do
17
- it {should belong_to :operator, :class_name => ::VIGILANTE_CONFIG['current_user_class']}
17
+ it {should belong_to(:operator).class_name(::VIGILANTE_CONFIG['current_user_class'])}
18
18
  it {should belong_to :ability}
19
19
  it {should have_many :authorization_extents}
20
20
 
data/spec/spec_helper.rb CHANGED
@@ -3,8 +3,7 @@ ENV["RAILS_ENV"] = "test"
3
3
 
4
4
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
5
  require "rspec/rails"
6
- require 'remarkable/active_record'
7
-
6
+ require 'shoulda/matchers'
8
7
  #Rails.backtrace_cleaner.remove_silencers!
9
8
  #
10
9
  ### Configure capybara for integration testing
data/vigilante.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: vigilante 1.0.3 ruby lib
5
+ # stub: vigilante 1.0.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "vigilante"
9
- s.version = "1.0.3"
9
+ s.version = "1.0.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Nathan Van der Auwera"]
14
- s.date = "2014-06-04"
14
+ s.date = "2015-06-10"
15
15
  s.description = "Vigilante is a db-backed authorisation, completely configurable and dynamic; where permissions can be limited to extents."
16
16
  s.email = "nathan@dixis.com"
17
17
  s.extra_rdoc_files = [
@@ -41,21 +41,13 @@ Gem::Specification.new do |s|
41
41
  "app/views/abilities/index.html.haml",
42
42
  "app/views/abilities/new.html.haml",
43
43
  "app/views/abilities/show.html.haml",
44
+ "db/migrate/20150609151817_create_permissions.rb",
45
+ "db/migrate/20150609151836_create_abilities.rb",
46
+ "db/migrate/20150609151845_create_ability_permissions.rb",
47
+ "db/migrate/20150609152056_create_authorizations.rb",
48
+ "db/migrate/20150609152444_create_authorization_extents.rb",
44
49
  "lib/config/vigilante_config.yml",
45
- "lib/db/migrate/20101028091755_create_permissions.rb",
46
- "lib/db/migrate/20101028091859_create_abilities.rb",
47
- "lib/db/migrate/20101028091927_create_ability_permissions.rb",
48
- "lib/db/migrate/20101028092014_create_authorizations.rb",
49
- "lib/db/migrate/20101124131334_add_extent_flag_to_ability.rb",
50
- "lib/db/migrate/20101129084538_add_authorization_extent.rb",
51
- "lib/db/migrate/20101129084620_remove_extent_from_authorization.rb",
52
- "lib/db/migrate/20130829160700_add_importance_to_abilities.rb",
53
50
  "lib/generators/vigilante/install/install_generator.rb",
54
- "lib/generators/vigilante/install/templates/create_abilities.rb",
55
- "lib/generators/vigilante/install/templates/create_ability_permissions.rb",
56
- "lib/generators/vigilante/install/templates/create_authorization_extents.rb",
57
- "lib/generators/vigilante/install/templates/create_authorizations.rb",
58
- "lib/generators/vigilante/install/templates/create_permissions.rb",
59
51
  "lib/generators/vigilante/install/templates/vigilante_config.yml",
60
52
  "lib/vigilante.rb",
61
53
  "lib/vigilante/active_record_extensions.rb",
@@ -126,25 +118,25 @@ Gem::Specification.new do |s|
126
118
  "vigilante.gemspec"
127
119
  ]
128
120
  s.homepage = "http://github.com/vigilante"
129
- s.rubygems_version = "2.2.1"
121
+ s.rubygems_version = "2.4.6"
130
122
  s.summary = "Context-based, db-backed authorisation for your rails3 apps"
131
123
 
132
124
  if s.respond_to? :specification_version then
133
125
  s.specification_version = 4
134
126
 
135
127
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
136
- s.add_runtime_dependency(%q<rails>, [">= 3.0.3"])
128
+ s.add_runtime_dependency(%q<rails>, [">= 4.0.0"])
137
129
  s.add_development_dependency(%q<jeweler>, [">= 0"])
138
- s.add_development_dependency(%q<rspec-rails>, [">= 2.4.0"])
130
+ s.add_development_dependency(%q<rspec-rails>, ["~> 2.14.0"])
139
131
  else
140
- s.add_dependency(%q<rails>, [">= 3.0.3"])
132
+ s.add_dependency(%q<rails>, [">= 4.0.0"])
141
133
  s.add_dependency(%q<jeweler>, [">= 0"])
142
- s.add_dependency(%q<rspec-rails>, [">= 2.4.0"])
134
+ s.add_dependency(%q<rspec-rails>, ["~> 2.14.0"])
143
135
  end
144
136
  else
145
- s.add_dependency(%q<rails>, [">= 3.0.3"])
137
+ s.add_dependency(%q<rails>, [">= 4.0.0"])
146
138
  s.add_dependency(%q<jeweler>, [">= 0"])
147
- s.add_dependency(%q<rspec-rails>, [">= 2.4.0"])
139
+ s.add_dependency(%q<rspec-rails>, ["~> 2.14.0"])
148
140
  end
149
141
  end
150
142
 
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vigilante
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Van der Auwera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-04 00:00:00.000000000 Z
11
+ date: 2015-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.3
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.3
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jeweler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.4.0
47
+ version: 2.14.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.4.0
54
+ version: 2.14.0
55
55
  description: Vigilante is a db-backed authorisation, completely configurable and dynamic;
56
56
  where permissions can be limited to extents.
57
57
  email: nathan@dixis.com
@@ -60,8 +60,8 @@ extensions: []
60
60
  extra_rdoc_files:
61
61
  - README.markdown
62
62
  files:
63
- - .document
64
- - .travis.yml
63
+ - ".document"
64
+ - ".travis.yml"
65
65
  - Gemfile
66
66
  - Gemfile.lock
67
67
  - History.md
@@ -83,21 +83,13 @@ files:
83
83
  - app/views/abilities/index.html.haml
84
84
  - app/views/abilities/new.html.haml
85
85
  - app/views/abilities/show.html.haml
86
+ - db/migrate/20150609151817_create_permissions.rb
87
+ - db/migrate/20150609151836_create_abilities.rb
88
+ - db/migrate/20150609151845_create_ability_permissions.rb
89
+ - db/migrate/20150609152056_create_authorizations.rb
90
+ - db/migrate/20150609152444_create_authorization_extents.rb
86
91
  - lib/config/vigilante_config.yml
87
- - lib/db/migrate/20101028091755_create_permissions.rb
88
- - lib/db/migrate/20101028091859_create_abilities.rb
89
- - lib/db/migrate/20101028091927_create_ability_permissions.rb
90
- - lib/db/migrate/20101028092014_create_authorizations.rb
91
- - lib/db/migrate/20101124131334_add_extent_flag_to_ability.rb
92
- - lib/db/migrate/20101129084538_add_authorization_extent.rb
93
- - lib/db/migrate/20101129084620_remove_extent_from_authorization.rb
94
- - lib/db/migrate/20130829160700_add_importance_to_abilities.rb
95
92
  - lib/generators/vigilante/install/install_generator.rb
96
- - lib/generators/vigilante/install/templates/create_abilities.rb
97
- - lib/generators/vigilante/install/templates/create_ability_permissions.rb
98
- - lib/generators/vigilante/install/templates/create_authorization_extents.rb
99
- - lib/generators/vigilante/install/templates/create_authorizations.rb
100
- - lib/generators/vigilante/install/templates/create_permissions.rb
101
93
  - lib/generators/vigilante/install/templates/vigilante_config.yml
102
94
  - lib/vigilante.rb
103
95
  - lib/vigilante/active_record_extensions.rb
@@ -175,17 +167,17 @@ require_paths:
175
167
  - lib
176
168
  required_ruby_version: !ruby/object:Gem::Requirement
177
169
  requirements:
178
- - - ! '>='
170
+ - - ">="
179
171
  - !ruby/object:Gem::Version
180
172
  version: '0'
181
173
  required_rubygems_version: !ruby/object:Gem::Requirement
182
174
  requirements:
183
- - - ! '>='
175
+ - - ">="
184
176
  - !ruby/object:Gem::Version
185
177
  version: '0'
186
178
  requirements: []
187
179
  rubyforge_project:
188
- rubygems_version: 2.2.1
180
+ rubygems_version: 2.4.6
189
181
  signing_key:
190
182
  specification_version: 4
191
183
  summary: Context-based, db-backed authorisation for your rails3 apps
@@ -1,14 +0,0 @@
1
- class CreateAbilities < ActiveRecord::Migration
2
- def self.up
3
- create_table :abilities do |t|
4
- t.string :name
5
- t.string :description
6
-
7
- t.timestamps
8
- end
9
- end
10
-
11
- def self.down
12
- drop_table :abilities
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- class CreateAbilityPermissions < ActiveRecord::Migration
2
- def self.up
3
- create_table :ability_permissions do |t|
4
- t.integer :ability_id
5
- t.integer :permission_id
6
-
7
- t.timestamps
8
- end
9
- end
10
-
11
- def self.down
12
- drop_table :ability_permissions
13
- end
14
- end
@@ -1,16 +0,0 @@
1
- class CreateAuthorizations < ActiveRecord::Migration
2
- def self.up
3
- create_table :authorizations do |t|
4
- t.integer :operator_id
5
- t.integer :ability_id
6
- t.string :extent
7
- t.string :extent_type
8
-
9
- t.timestamps
10
- end
11
- end
12
-
13
- def self.down
14
- drop_table :authorizations
15
- end
16
- end
@@ -1,9 +0,0 @@
1
- class AddExtentFlagToAbility < ActiveRecord::Migration
2
- def self.up
3
- add_column :abilities, :needs_extent, :boolean
4
- end
5
-
6
- def self.down
7
- remove_column :abilities, :needs_extent, :boolean
8
- end
9
- end
@@ -1,15 +0,0 @@
1
- class AddAuthorizationExtent < ActiveRecord::Migration
2
- def self.up
3
- create_table :authorization_extents do |t|
4
- t.integer :authorization_id
5
- t.string :extent_type
6
- t.integer :extent_objid
7
-
8
- t.timestamps
9
- end
10
- end
11
-
12
- def self.down
13
- drop_table :authorization_extents
14
- end
15
- end
@@ -1,11 +0,0 @@
1
- class RemoveExtentFromAuthorization < ActiveRecord::Migration
2
- def self.up
3
- remove_column :authorizations, :extent
4
- remove_column :authorizations, :extent_type
5
- end
6
-
7
- def self.down
8
- add_column :authorizations, :extent, :string
9
- add_column :authorizations, :extent_type, :string
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- class CreateAbilityPermissions < ActiveRecord::Migration
2
- def self.change
3
- change_table :abilities do |t|
4
- t.integer :importance
5
- end
6
- end
7
- end
@@ -1,14 +0,0 @@
1
- class CreateAbilityPermissions < ActiveRecord::Migration
2
- def self.up
3
- create_table :ability_permissions do |t|
4
- t.integer :ability_id
5
- t.integer :permission_id
6
-
7
- t.timestamps
8
- end
9
- end
10
-
11
- def self.down
12
- drop_table :ability_permissions
13
- end
14
- end
@@ -1,15 +0,0 @@
1
- class CreateAuthorizationExtents < ActiveRecord::Migration
2
- def self.up
3
- create_table :authorization_extents do |t|
4
- t.integer :authorization_id
5
- t.string :extent_type
6
- t.integer :extent_objid
7
-
8
- t.timestamps
9
- end
10
- end
11
-
12
- def self.down
13
- drop_table :authorization_extents
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- class CreateAuthorizations < ActiveRecord::Migration
2
- def self.up
3
- create_table :authorizations do |t|
4
- t.integer :operator_id
5
- t.integer :ability_id
6
- t.timestamps
7
- end
8
- end
9
-
10
- def self.down
11
- drop_table :authorizations
12
- end
13
- end
@@ -1,13 +0,0 @@
1
- class CreatePermissions < ActiveRecord::Migration
2
- def self.up
3
- create_table :permissions do |t|
4
- t.string :allowed_action
5
-
6
- t.timestamps
7
- end
8
- end
9
-
10
- def self.down
11
- drop_table :permissions
12
- end
13
- end