vigilante 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/VERSION +1 -1
- data/app/controllers/abilities_controller.rb +29 -1
- data/app/models/ability.rb +3 -0
- data/app/models/ability_permission.rb +2 -0
- data/app/views/abilities/_ability_permission_fields.html.haml +11 -0
- data/app/views/abilities/_form.html.haml +19 -0
- data/app/views/abilities/_permission_fields.html.haml +2 -0
- data/app/views/abilities/edit.html.haml +3 -0
- data/app/views/abilities/index.html.haml +2 -0
- data/app/views/abilities/new.html.haml +3 -0
- data/app/views/abilities/show.html.haml +66 -63
- data/lib/db/migrate/20130829160700_add_importance_to_abilities.rb +7 -0
- data/lib/vigilante/authorization.rb +50 -30
- data/lib/vigilante/watched_operator.rb +1 -1
- data/vigilante.gemspec +152 -0
- metadata +42 -59
- /data/lib/generators/vigilante/install/templates/{watchman_config.yml → vigilante_config.yml} +0 -0
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -35,8 +35,8 @@ GEM
|
|
35
35
|
abstract (>= 1.0.0)
|
36
36
|
git (1.2.5)
|
37
37
|
i18n (0.5.0)
|
38
|
-
jeweler (1.
|
39
|
-
bundler (~> 1.0
|
38
|
+
jeweler (1.6.4)
|
39
|
+
bundler (~> 1.0)
|
40
40
|
git (>= 1.2.5)
|
41
41
|
rake
|
42
42
|
mail (2.2.14)
|
@@ -64,7 +64,7 @@ GEM
|
|
64
64
|
activesupport (= 3.0.3)
|
65
65
|
rake (>= 0.8.7)
|
66
66
|
thor (~> 0.14.4)
|
67
|
-
rake (0.
|
67
|
+
rake (0.9.2)
|
68
68
|
remarkable (4.0.0.alpha4)
|
69
69
|
rspec (>= 2.0.0.alpha11)
|
70
70
|
remarkable_activemodel (4.0.0.alpha4)
|
@@ -98,7 +98,7 @@ PLATFORMS
|
|
98
98
|
|
99
99
|
DEPENDENCIES
|
100
100
|
jeweler
|
101
|
-
rails (
|
101
|
+
rails (>= 3.0.3)
|
102
102
|
remarkable (>= 4.0.0.alpha4)
|
103
103
|
remarkable_activemodel (>= 4.0.0.alpha4)
|
104
104
|
remarkable_activerecord (>= 4.0.0.alpha4)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
@@ -10,9 +10,37 @@ class AbilitiesController < ApplicationController
|
|
10
10
|
@ability = Ability.find(params[:id])
|
11
11
|
end
|
12
12
|
|
13
|
+
def new
|
14
|
+
@ability = Ability.new
|
15
|
+
end
|
13
16
|
|
14
|
-
|
17
|
+
def create
|
18
|
+
@ability = Ability.new(params[:ability])
|
19
|
+
if @ability.save
|
20
|
+
flash[:notice] = t('ability.created')
|
21
|
+
redirect_to :action => :index
|
22
|
+
else
|
23
|
+
render 'new'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def edit
|
29
|
+
@ability = Ability.find(params[:id])
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
@ability = Ability.find(params[:id])
|
15
34
|
|
35
|
+
if @ability.update_attributes(params[:ability])
|
36
|
+
flash[:notice] = t('ability.saved')
|
37
|
+
redirect_to :action => :index
|
38
|
+
else
|
39
|
+
render 'edit'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
16
44
|
|
17
45
|
|
18
46
|
end
|
data/app/models/ability.rb
CHANGED
@@ -2,5 +2,8 @@ class Ability < ActiveRecord::Base
|
|
2
2
|
has_many :ability_permissions
|
3
3
|
has_many :permissions, :through => :ability_permissions
|
4
4
|
|
5
|
+
accepts_nested_attributes_for :permissions
|
6
|
+
accepts_nested_attributes_for :ability_permissions
|
7
|
+
|
5
8
|
scope :that_need_extent, lambda { where('needs_extent=?', true)}
|
6
9
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.nested-fields.ability-permission-fields
|
2
|
+
|
3
|
+
.row-fluid
|
4
|
+
.span4
|
5
|
+
#permission_from_list
|
6
|
+
= f.association :permission, :collection => Permission.all(:order => 'allowed_action'), :prompt => 'Choose an existing permission', :label_method => :allowed_action
|
7
|
+
.span4
|
8
|
+
#actions-on-permission{:style => 'line-height: 20px; margin-top: 5px;'}
|
9
|
+
- if f.object.new_record?
|
10
|
+
= link_to_add_association 'or create a new permission', f, :permission
|
11
|
+
= link_to_remove_association "remove permission", f
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
= simple_form_for @ability, :html => {:class => 'form-horizontal' } do |f|
|
3
|
+
= f.input :name
|
4
|
+
= f.input :description
|
5
|
+
|
6
|
+
%h2 Allowed actions
|
7
|
+
#permissions
|
8
|
+
= f.simple_fields_for :ability_permissions do |abp|
|
9
|
+
= render 'ability_permission_fields', :f => abp
|
10
|
+
|
11
|
+
.control-group
|
12
|
+
.controls
|
13
|
+
= link_to_add_association 'add a permission', f, :ability_permissions
|
14
|
+
|
15
|
+
.control-group
|
16
|
+
.controls
|
17
|
+
= f.submit "Save", :class=>"btn btn-primary"
|
18
|
+
= link_to "Cancel", abilities_path, :class => 'btn'
|
19
|
+
|
@@ -1,71 +1,74 @@
|
|
1
|
-
%table.resource_attributes
|
2
|
-
%tr
|
3
|
-
%th Name
|
4
|
-
%td= @ability.name
|
5
|
-
%tr
|
6
|
-
%th Description
|
7
|
-
%td= @ability.description
|
8
1
|
|
2
|
+
.span6
|
3
|
+
%table.table
|
4
|
+
%tr
|
5
|
+
%th Name
|
6
|
+
%td= @ability.name
|
7
|
+
%tr
|
8
|
+
%th Description
|
9
|
+
%td= @ability.description
|
9
10
|
|
10
|
-
%h2 Allowed actions
|
11
11
|
|
12
|
+
%h2 Allowed actions
|
12
13
|
|
14
|
+
%table.table
|
15
|
+
- @ability.permissions.each do |perm|
|
16
|
+
%tr
|
17
|
+
%td= perm.allowed_action
|
13
18
|
|
14
|
-
|
15
|
-
- @ability.permissions.each do |perm|
|
16
|
-
%tr
|
17
|
-
%td= perm.allowed_action
|
19
|
+
= link_to 'Edit', edit_ability_path(@ability), :class => 'btn btn-mini' if is_allowed_to?(@ability, :edit)
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
.span4
|
22
|
+
#abilities_explanation.help_text.well
|
23
|
+
%p
|
24
|
+
Allowed actions are specified as follows:
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
26
|
+
%ul
|
27
|
+
%li
|
28
|
+
%pre
|
29
|
+
posts[index, show]
|
30
|
+
%ul
|
31
|
+
%li
|
32
|
+
Only the things that are explicitly specified are allowed.
|
33
|
+
This declares that on the
|
34
|
+
%tt
|
35
|
+
PostsController
|
36
|
+
only
|
37
|
+
%tt
|
38
|
+
index
|
39
|
+
and
|
40
|
+
%tt
|
41
|
+
show
|
42
|
+
are allowed.
|
43
|
+
%li
|
44
|
+
%pre
|
45
|
+
*[index, show, report]
|
46
|
+
%ul
|
47
|
+
%li
|
48
|
+
We also allow wild-cards. Instead of a controller-name, we could write
|
49
|
+
%tt
|
50
|
+
*
|
51
|
+
which would mean the specified actions would apply to all controllers.
|
52
|
+
%li
|
53
|
+
%pre
|
54
|
+
posts[all]
|
55
|
+
%ul
|
56
|
+
%li
|
57
|
+
If we write
|
58
|
+
%tt
|
59
|
+
all
|
60
|
+
instead of a specific action or list of actions, then all actions are allowed for a given controller.
|
61
|
+
In this case a user has the ability to access all actions inside the posts_controller.
|
62
|
+
%li
|
63
|
+
%pre
|
64
|
+
*[all]
|
65
|
+
%ul
|
66
|
+
%li
|
67
|
+
By extension, this means a user has the ability to access all actions from all controllers.
|
68
|
+
%p
|
69
|
+
When abilities are assigned (authorisation), it is possible to specify the extent of the ability.
|
70
|
+
What this means depends on your website, but in case of e.g. a blog-host (like blogger), this means that a
|
71
|
+
%tt
|
72
|
+
author
|
73
|
+
's permissions could only be valid on those blogs he owns or has access to.
|
71
74
|
|
@@ -2,9 +2,25 @@ module Vigilante
|
|
2
2
|
module Authorization
|
3
3
|
|
4
4
|
def self.included(base)
|
5
|
+
current_user_method = VIGILANTE_CONFIG['current_user_method']
|
6
|
+
|
5
7
|
base.helper_method :is_allowed_to?
|
6
|
-
base.helper_method
|
7
|
-
base.helper_method
|
8
|
+
base.helper_method "get_#{current_user_method}_extent_of".to_sym
|
9
|
+
base.helper_method "get_#{current_user_method}_permissions_are_global?".to_sym
|
10
|
+
|
11
|
+
define_method "get_#{current_user_method}_extent_of" do |controller_name, action|
|
12
|
+
get_protectee_permissions.get_extent_of(controller_name, action)
|
13
|
+
end
|
14
|
+
|
15
|
+
# needed? --> tells if the current_operator has only global permissions
|
16
|
+
define_method "get_#{current_user_method}_permissions_are_global?" do
|
17
|
+
get_protectee_permissions.are_only_global?
|
18
|
+
end
|
19
|
+
|
20
|
+
define_method "get_#{current_user_method}_permissions" do
|
21
|
+
get_protectee_permissions
|
22
|
+
end
|
23
|
+
|
8
24
|
end
|
9
25
|
|
10
26
|
# ******************************************************************
|
@@ -26,6 +42,19 @@ module Vigilante
|
|
26
42
|
self.send(application_method) if application_method.present?
|
27
43
|
end
|
28
44
|
|
45
|
+
# this will return the current user/operator/... that is guarded by vigilante
|
46
|
+
def get_protectee
|
47
|
+
current_user_method = VIGILANTE_CONFIG['current_user_method']
|
48
|
+
|
49
|
+
Rails.logger.debug "current_user_method = #{current_user_method}"
|
50
|
+
|
51
|
+
@protectee ||= self.send(current_user_method) if current_user_method.present?
|
52
|
+
|
53
|
+
Rails.logger.debug "Protectee = #{@protectee.user_name}"
|
54
|
+
|
55
|
+
@protectee
|
56
|
+
end
|
57
|
+
|
29
58
|
|
30
59
|
# ******************************************************************
|
31
60
|
# explicitely call the Vigilante filter in each controller that requires Vigilante protection :
|
@@ -40,7 +69,7 @@ module Vigilante
|
|
40
69
|
def check_permissions(options={})
|
41
70
|
logger.debug "CHECK PERMISSIONS"
|
42
71
|
# a logged in operator can do ajax-requests
|
43
|
-
return if
|
72
|
+
return if get_protectee.present? && request.xhr?
|
44
73
|
|
45
74
|
controller_to_check = options[:as].nil? ? controller_name : options[:as]
|
46
75
|
|
@@ -83,23 +112,14 @@ module Vigilante
|
|
83
112
|
|
84
113
|
def is_allowed_to?(controller_name, action, context=get_current_context_from_application)
|
85
114
|
logger.debug "is_allowed_to? #{controller_name.inspect}##{action} [#{context.inspect}]"
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
|
90
|
-
def get_current_operator_extent_of(controller_name, action)
|
91
|
-
get_current_operator_permissions.get_extent_of(controller_name, action)
|
115
|
+
get_protectee_permissions.is_allowed_by_context(controller_name, action, get_extent_from_context(context))
|
92
116
|
end
|
93
117
|
|
94
|
-
|
95
|
-
def get_current_operator_permissions_are_global?
|
96
|
-
get_current_operator_permissions.are_only_global?
|
97
|
-
end
|
98
|
-
|
99
|
-
def get_current_operator_permissions
|
118
|
+
def get_protectee_permissions
|
100
119
|
@permits ||= session[:permits]
|
101
120
|
if @permits.nil?
|
102
|
-
|
121
|
+
Rails.logger.debug "determine permissions ... "
|
122
|
+
@permits = get_protectee.permits
|
103
123
|
session[:permits] = @permits
|
104
124
|
end
|
105
125
|
@permits
|
@@ -130,20 +150,20 @@ module Vigilante
|
|
130
150
|
|
131
151
|
# ******************************************************************
|
132
152
|
|
133
|
-
def find_objects
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
end
|
139
|
-
|
140
|
-
|
141
|
-
def find_object
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
end
|
153
|
+
#def find_objects
|
154
|
+
# handle_context_for_nested_resources
|
155
|
+
# model = Kernel.const_get(model_name)
|
156
|
+
# objects = model.find_all_by_operator(get_protectee, params)
|
157
|
+
# instance_variable_set "@#{model_name.underscore.pluralize}", objects
|
158
|
+
#end
|
159
|
+
#
|
160
|
+
#
|
161
|
+
#def find_object
|
162
|
+
# handle_context_for_nested_resources
|
163
|
+
# model = Kernel.const_get(model_name)
|
164
|
+
# object = model.find_by_operator(get_protectee, params[:id], params)
|
165
|
+
# instance_variable_set "@#{model_name.underscore}", object
|
166
|
+
#end
|
147
167
|
|
148
168
|
|
149
169
|
# returns the model-name for this controller
|
@@ -19,7 +19,7 @@ module Vigilante
|
|
19
19
|
# extent_params[:extent_type] = extent.class.name
|
20
20
|
# end
|
21
21
|
|
22
|
-
new_authorization =
|
22
|
+
new_authorization = ::Authorization.create(:operator_id => self.id, :ability_id => ability.id)
|
23
23
|
unless extent.nil?
|
24
24
|
new_authorization.add_extent(extent)
|
25
25
|
end
|
data/vigilante.gemspec
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "vigilante"
|
8
|
+
s.version = "1.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Nathan Van der Auwera"]
|
12
|
+
s.date = "2013-09-16"
|
13
|
+
s.description = "Vigilante is a db-backed authorisation, completely configurable and dynamic; where permissions can be limited to extents."
|
14
|
+
s.email = "nathan@dixis.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.markdown"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".document",
|
20
|
+
".travis.yml",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"History.md",
|
24
|
+
"MIT-LICENSE",
|
25
|
+
"README.markdown",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"app/controllers/abilities_controller.rb",
|
29
|
+
"app/models/ability.rb",
|
30
|
+
"app/models/ability_permission.rb",
|
31
|
+
"app/models/authorization.rb",
|
32
|
+
"app/models/authorization_extent.rb",
|
33
|
+
"app/models/permission.rb",
|
34
|
+
"app/models/permission_hash.rb",
|
35
|
+
"app/views/abilities/_ability_permission_fields.html.haml",
|
36
|
+
"app/views/abilities/_form.html.haml",
|
37
|
+
"app/views/abilities/_permission_fields.html.haml",
|
38
|
+
"app/views/abilities/edit.html.haml",
|
39
|
+
"app/views/abilities/index.html.haml",
|
40
|
+
"app/views/abilities/new.html.haml",
|
41
|
+
"app/views/abilities/show.html.haml",
|
42
|
+
"lib/config/vigilante_config.yml",
|
43
|
+
"lib/db/migrate/20101028091755_create_permissions.rb",
|
44
|
+
"lib/db/migrate/20101028091859_create_abilities.rb",
|
45
|
+
"lib/db/migrate/20101028091927_create_ability_permissions.rb",
|
46
|
+
"lib/db/migrate/20101028092014_create_authorizations.rb",
|
47
|
+
"lib/db/migrate/20101124131334_add_extent_flag_to_ability.rb",
|
48
|
+
"lib/db/migrate/20101129084538_add_authorization_extent.rb",
|
49
|
+
"lib/db/migrate/20101129084620_remove_extent_from_authorization.rb",
|
50
|
+
"lib/db/migrate/20130829160700_add_importance_to_abilities.rb",
|
51
|
+
"lib/generators/vigilante/install/install_generator.rb",
|
52
|
+
"lib/generators/vigilante/install/templates/create_abilities.rb",
|
53
|
+
"lib/generators/vigilante/install/templates/create_ability_permissions.rb",
|
54
|
+
"lib/generators/vigilante/install/templates/create_authorization_extents.rb",
|
55
|
+
"lib/generators/vigilante/install/templates/create_authorizations.rb",
|
56
|
+
"lib/generators/vigilante/install/templates/create_permissions.rb",
|
57
|
+
"lib/generators/vigilante/install/templates/vigilante_config.yml",
|
58
|
+
"lib/vigilante.rb",
|
59
|
+
"lib/vigilante/active_record_extensions.rb",
|
60
|
+
"lib/vigilante/authorization.rb",
|
61
|
+
"lib/vigilante/controller_extension.rb",
|
62
|
+
"lib/vigilante/finder_helper.rb",
|
63
|
+
"lib/vigilante/watched_operator.rb",
|
64
|
+
"spec/controllers/application_controller_spec.rb",
|
65
|
+
"spec/controllers/blogs_controller_spec.rb",
|
66
|
+
"spec/dummy/Rakefile",
|
67
|
+
"spec/dummy/app/controllers/application_controller.rb",
|
68
|
+
"spec/dummy/app/controllers/blogs_controller.rb",
|
69
|
+
"spec/dummy/app/helpers/application_helper.rb",
|
70
|
+
"spec/dummy/app/models/author.rb",
|
71
|
+
"spec/dummy/app/models/blog.rb",
|
72
|
+
"spec/dummy/app/models/post.rb",
|
73
|
+
"spec/dummy/app/views/layouts/application.html.erb",
|
74
|
+
"spec/dummy/config.ru",
|
75
|
+
"spec/dummy/config/application.rb",
|
76
|
+
"spec/dummy/config/boot.rb",
|
77
|
+
"spec/dummy/config/database.yml",
|
78
|
+
"spec/dummy/config/environment.rb",
|
79
|
+
"spec/dummy/config/environments/development.rb",
|
80
|
+
"spec/dummy/config/environments/production.rb",
|
81
|
+
"spec/dummy/config/environments/test.rb",
|
82
|
+
"spec/dummy/config/initializers/backtrace_silencers.rb",
|
83
|
+
"spec/dummy/config/initializers/inflections.rb",
|
84
|
+
"spec/dummy/config/initializers/mime_types.rb",
|
85
|
+
"spec/dummy/config/initializers/secret_token.rb",
|
86
|
+
"spec/dummy/config/initializers/session_store.rb",
|
87
|
+
"spec/dummy/config/locales/en.yml",
|
88
|
+
"spec/dummy/config/routes.rb",
|
89
|
+
"spec/dummy/config/vigilante_config.yml",
|
90
|
+
"spec/dummy/db/migrate/20101028091755_create_permissions.rb",
|
91
|
+
"spec/dummy/db/migrate/20101028091859_create_abilities.rb",
|
92
|
+
"spec/dummy/db/migrate/20101028091927_create_ability_permissions.rb",
|
93
|
+
"spec/dummy/db/migrate/20101028092014_create_authorizations.rb",
|
94
|
+
"spec/dummy/db/migrate/20101124131334_add_extent_flag_to_ability.rb",
|
95
|
+
"spec/dummy/db/migrate/20101129084538_add_authorization_extent.rb",
|
96
|
+
"spec/dummy/db/migrate/20101129084620_remove_extent_from_authorization.rb",
|
97
|
+
"spec/dummy/db/migrate/20110118120344_create_blogs.rb",
|
98
|
+
"spec/dummy/db/migrate/20110118120421_create_posts.rb",
|
99
|
+
"spec/dummy/db/migrate/20110118120448_create_authors.rb",
|
100
|
+
"spec/dummy/db/schema.rb",
|
101
|
+
"spec/dummy/db/seeds.rb",
|
102
|
+
"spec/dummy/db/seeds/initial_watchman_permissions.rb",
|
103
|
+
"spec/dummy/public/404.html",
|
104
|
+
"spec/dummy/public/422.html",
|
105
|
+
"spec/dummy/public/500.html",
|
106
|
+
"spec/dummy/public/favicon.ico",
|
107
|
+
"spec/dummy/public/javascripts/application.js",
|
108
|
+
"spec/dummy/public/javascripts/controls.js",
|
109
|
+
"spec/dummy/public/javascripts/dragdrop.js",
|
110
|
+
"spec/dummy/public/javascripts/effects.js",
|
111
|
+
"spec/dummy/public/javascripts/prototype.js",
|
112
|
+
"spec/dummy/public/javascripts/rails.js",
|
113
|
+
"spec/dummy/public/stylesheets/.gitkeep",
|
114
|
+
"spec/dummy/script/rails",
|
115
|
+
"spec/models/ability_permission_spec.rb",
|
116
|
+
"spec/models/ability_spec.rb",
|
117
|
+
"spec/models/author_spec.rb",
|
118
|
+
"spec/models/authorization_extent_spec.rb",
|
119
|
+
"spec/models/authorization_spec.rb",
|
120
|
+
"spec/models/permission_hash_spec.rb",
|
121
|
+
"spec/models/permission_spec.rb",
|
122
|
+
"spec/spec_helper.rb",
|
123
|
+
"spec/vigilante_spec.rb",
|
124
|
+
"vigilante.gemspec"
|
125
|
+
]
|
126
|
+
s.homepage = "http://github.com/vigilante"
|
127
|
+
s.require_paths = ["lib"]
|
128
|
+
s.rubygems_version = "1.8.25"
|
129
|
+
s.summary = "Context-based, db-backed authorisation for your rails3 apps"
|
130
|
+
|
131
|
+
if s.respond_to? :specification_version then
|
132
|
+
s.specification_version = 3
|
133
|
+
|
134
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
135
|
+
s.add_runtime_dependency(%q<rails>, [">= 3.0.3"])
|
136
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
137
|
+
s.add_development_dependency(%q<rspec-rails>, [">= 2.4.0"])
|
138
|
+
s.add_development_dependency(%q<rails>, [">= 3.0.0"])
|
139
|
+
else
|
140
|
+
s.add_dependency(%q<rails>, [">= 3.0.3"])
|
141
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
142
|
+
s.add_dependency(%q<rspec-rails>, [">= 2.4.0"])
|
143
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
144
|
+
end
|
145
|
+
else
|
146
|
+
s.add_dependency(%q<rails>, [">= 3.0.3"])
|
147
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
148
|
+
s.add_dependency(%q<rspec-rails>, [">= 2.4.0"])
|
149
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vigilante
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,23 +9,27 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
12
|
+
date: 2013-09-16 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rails
|
17
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
|
-
- -
|
19
|
+
- - ! '>='
|
21
20
|
- !ruby/object:Gem::Version
|
22
21
|
version: 3.0.3
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.3
|
26
30
|
- !ruby/object:Gem::Dependency
|
27
31
|
name: jeweler
|
28
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
29
33
|
none: false
|
30
34
|
requirements:
|
31
35
|
- - ! '>='
|
@@ -33,10 +37,15 @@ dependencies:
|
|
33
37
|
version: '0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
37
46
|
- !ruby/object:Gem::Dependency
|
38
47
|
name: rspec-rails
|
39
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
40
49
|
none: false
|
41
50
|
requirements:
|
42
51
|
- - ! '>='
|
@@ -44,10 +53,15 @@ dependencies:
|
|
44
53
|
version: 2.4.0
|
45
54
|
type: :development
|
46
55
|
prerelease: false
|
47
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.4.0
|
48
62
|
- !ruby/object:Gem::Dependency
|
49
63
|
name: rails
|
50
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
51
65
|
none: false
|
52
66
|
requirements:
|
53
67
|
- - ! '>='
|
@@ -55,7 +69,12 @@ dependencies:
|
|
55
69
|
version: 3.0.0
|
56
70
|
type: :development
|
57
71
|
prerelease: false
|
58
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 3.0.0
|
59
78
|
description: Vigilante is a db-backed authorisation, completely configurable and dynamic;
|
60
79
|
where permissions can be limited to extents.
|
61
80
|
email: nathan@dixis.com
|
@@ -80,7 +99,12 @@ files:
|
|
80
99
|
- app/models/authorization_extent.rb
|
81
100
|
- app/models/permission.rb
|
82
101
|
- app/models/permission_hash.rb
|
102
|
+
- app/views/abilities/_ability_permission_fields.html.haml
|
103
|
+
- app/views/abilities/_form.html.haml
|
104
|
+
- app/views/abilities/_permission_fields.html.haml
|
105
|
+
- app/views/abilities/edit.html.haml
|
83
106
|
- app/views/abilities/index.html.haml
|
107
|
+
- app/views/abilities/new.html.haml
|
84
108
|
- app/views/abilities/show.html.haml
|
85
109
|
- lib/config/vigilante_config.yml
|
86
110
|
- lib/db/migrate/20101028091755_create_permissions.rb
|
@@ -90,13 +114,14 @@ files:
|
|
90
114
|
- lib/db/migrate/20101124131334_add_extent_flag_to_ability.rb
|
91
115
|
- lib/db/migrate/20101129084538_add_authorization_extent.rb
|
92
116
|
- lib/db/migrate/20101129084620_remove_extent_from_authorization.rb
|
117
|
+
- lib/db/migrate/20130829160700_add_importance_to_abilities.rb
|
93
118
|
- lib/generators/vigilante/install/install_generator.rb
|
94
119
|
- lib/generators/vigilante/install/templates/create_abilities.rb
|
95
120
|
- lib/generators/vigilante/install/templates/create_ability_permissions.rb
|
96
121
|
- lib/generators/vigilante/install/templates/create_authorization_extents.rb
|
97
122
|
- lib/generators/vigilante/install/templates/create_authorizations.rb
|
98
123
|
- lib/generators/vigilante/install/templates/create_permissions.rb
|
99
|
-
- lib/generators/vigilante/install/templates/
|
124
|
+
- lib/generators/vigilante/install/templates/vigilante_config.yml
|
100
125
|
- lib/vigilante.rb
|
101
126
|
- lib/vigilante/active_record_extensions.rb
|
102
127
|
- lib/vigilante/authorization.rb
|
@@ -163,7 +188,7 @@ files:
|
|
163
188
|
- spec/models/permission_spec.rb
|
164
189
|
- spec/spec_helper.rb
|
165
190
|
- spec/vigilante_spec.rb
|
166
|
-
|
191
|
+
- vigilante.gemspec
|
167
192
|
homepage: http://github.com/vigilante
|
168
193
|
licenses: []
|
169
194
|
post_install_message:
|
@@ -178,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
203
|
version: '0'
|
179
204
|
segments:
|
180
205
|
- 0
|
181
|
-
hash: -
|
206
|
+
hash: -1531748600046147713
|
182
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
208
|
none: false
|
184
209
|
requirements:
|
@@ -187,50 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
212
|
version: '0'
|
188
213
|
requirements: []
|
189
214
|
rubyforge_project:
|
190
|
-
rubygems_version: 1.
|
215
|
+
rubygems_version: 1.8.25
|
191
216
|
signing_key:
|
192
217
|
specification_version: 3
|
193
218
|
summary: Context-based, db-backed authorisation for your rails3 apps
|
194
|
-
test_files:
|
195
|
-
- spec/controllers/application_controller_spec.rb
|
196
|
-
- spec/controllers/blogs_controller_spec.rb
|
197
|
-
- spec/dummy/app/controllers/application_controller.rb
|
198
|
-
- spec/dummy/app/controllers/blogs_controller.rb
|
199
|
-
- spec/dummy/app/helpers/application_helper.rb
|
200
|
-
- spec/dummy/app/models/author.rb
|
201
|
-
- spec/dummy/app/models/blog.rb
|
202
|
-
- spec/dummy/app/models/post.rb
|
203
|
-
- spec/dummy/config/application.rb
|
204
|
-
- spec/dummy/config/boot.rb
|
205
|
-
- spec/dummy/config/environment.rb
|
206
|
-
- spec/dummy/config/environments/development.rb
|
207
|
-
- spec/dummy/config/environments/production.rb
|
208
|
-
- spec/dummy/config/environments/test.rb
|
209
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
210
|
-
- spec/dummy/config/initializers/inflections.rb
|
211
|
-
- spec/dummy/config/initializers/mime_types.rb
|
212
|
-
- spec/dummy/config/initializers/secret_token.rb
|
213
|
-
- spec/dummy/config/initializers/session_store.rb
|
214
|
-
- spec/dummy/config/routes.rb
|
215
|
-
- spec/dummy/db/migrate/20101028091755_create_permissions.rb
|
216
|
-
- spec/dummy/db/migrate/20101028091859_create_abilities.rb
|
217
|
-
- spec/dummy/db/migrate/20101028091927_create_ability_permissions.rb
|
218
|
-
- spec/dummy/db/migrate/20101028092014_create_authorizations.rb
|
219
|
-
- spec/dummy/db/migrate/20101124131334_add_extent_flag_to_ability.rb
|
220
|
-
- spec/dummy/db/migrate/20101129084538_add_authorization_extent.rb
|
221
|
-
- spec/dummy/db/migrate/20101129084620_remove_extent_from_authorization.rb
|
222
|
-
- spec/dummy/db/migrate/20110118120344_create_blogs.rb
|
223
|
-
- spec/dummy/db/migrate/20110118120421_create_posts.rb
|
224
|
-
- spec/dummy/db/migrate/20110118120448_create_authors.rb
|
225
|
-
- spec/dummy/db/schema.rb
|
226
|
-
- spec/dummy/db/seeds.rb
|
227
|
-
- spec/dummy/db/seeds/initial_watchman_permissions.rb
|
228
|
-
- spec/models/ability_permission_spec.rb
|
229
|
-
- spec/models/ability_spec.rb
|
230
|
-
- spec/models/author_spec.rb
|
231
|
-
- spec/models/authorization_extent_spec.rb
|
232
|
-
- spec/models/authorization_spec.rb
|
233
|
-
- spec/models/permission_hash_spec.rb
|
234
|
-
- spec/models/permission_spec.rb
|
235
|
-
- spec/spec_helper.rb
|
236
|
-
- spec/vigilante_spec.rb
|
219
|
+
test_files: []
|
/data/lib/generators/vigilante/install/templates/{watchman_config.yml → vigilante_config.yml}
RENAMED
File without changes
|