thelinuxlich-aegis 1.1.7 → 1.1.8

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.
data/:test ADDED
File without changes
data/README.rdoc CHANGED
@@ -1,195 +1,202 @@
1
- = Aegis - role-based permissions for your user models
2
-
3
- Aegis allows you to manage fine-grained, complex permission for user accounts in a central place.
4
-
5
- == Installation
6
-
7
- Add the following to your <tt>Initializer.run</tt> block in your <tt>environment.rb</tt>:
8
- config.gem 'aegis', :source => 'http://gemcutter.org'
9
- Then do a
10
- sudo rake gems:install
11
-
12
- Alternatively, use
13
- sudo gem sources -a http://gemcutter.org
14
- sudo gem install aegis
15
-
16
- == Example
17
-
18
- First, let's define some roles:
19
-
20
- # app/models/permissions.rb
21
- class Permissions < Aegis::Permissions
22
-
23
- role :guest
24
- role :registered_user
25
- role :moderator
26
- role :administrator, :default_permission => :allow
27
-
28
- permission :edit_post do |user, post|
29
- allow :registered_user do
30
- post.creator == user # a registered_user can only edit his own posts
31
- end
32
- allow :moderator
33
- end
34
-
35
- permission :read_post do |post|
36
- allow :everyone
37
- deny :guest do
38
- post.private? # guests may not read private posts
39
- end
40
- end
41
-
42
- end
43
-
44
-
45
- Now we assign roles to users. For this, the users table needs to have a string
46
- column +role_name+.
47
-
48
- # app/models/user.rb
49
- class User
50
- has_role
51
- end
52
-
53
-
54
- These permissions may be used in views and controllers:
55
-
56
- # app/views/posts/index.html.erb
57
- @posts.each do |post|
58
- <% if current_user.may_read_post? post %>
59
- <%= render post %>
60
- <% if current_user.may_edit_post? post %>
61
- <%= link_to 'Edit', edit_post_path(post) %>
62
- <% end %>
63
- <% end %>
64
- <% end %>
65
-
66
-
67
- # app/controllers/posts_controller.rb
68
- class PostsController
69
- # ...
70
-
71
- def update
72
- @post = Post.find(params[:id])
73
- current_user.may_edit_post! @post # raises an Aegis::PermissionError for unauthorized access
74
- # ...
75
- end
76
-
77
- end
78
-
79
- == Details
80
-
81
- === Roles
82
-
83
- To equip a (user) model with any permissions, you simply call *has_role* within
84
- the model:
85
- class User < ActiveRecord::Base
86
- has_role
87
- end
88
- Aegis assumes that the corresponding database table has a string-valued column
89
- called +role_name+. You may override the name with the <tt>:name_accessor =>
90
- :my_role_column</tt> option.
91
-
92
- You can define a default role for a model by saying
93
- class User < ActiveRecord::Base
94
- has_role :default => :admin
95
- end
96
- All this will do, is initialize the +role_name+ with the given default when
97
- <tt>User.new</tt> is called.
98
-
99
- The roles and permissions themselves are defined in a class inheriting from
100
- <b>Aegis::Permissions</b>. To define roles you create a model <tt>permissions.rb</tt>
101
- and use the *role* method:
102
- class Permissions < Aegis::Permissions
103
- role 'role_name'
104
- end
105
-
106
- By default, users belonging to this role are not permitted anything. You may
107
- override this with <tt>:default_permission => :allow</tt>, e.g.
108
- role 'admin', :default_permission => :allow
109
-
110
- === Permissions
111
-
112
- Permissions are specified with the *permission* method and *allow* and *deny*
113
- permission :do_something do
114
- allow :role_a, :role_b
115
- deny :role_c
116
- end
117
-
118
- Your user model just received two methods called <b>User#may_do_something?</b>
119
- and <b>User#may_do_something!</b>. The first one with the ? returns true for users with
120
- +role_a+ and +role_b+, and false for users with +role_c+. The second one with the ! raises an
121
- Aegis::PermissionError for +role_c+.
122
-
123
- === Normalization
124
-
125
- Aegis will perform some normalization. For example, the permissions
126
- +edit_something+ and +update_something+ will be the same, each granting both
127
- <tt>may_edit_something?</tt> and <tt>may_update_something?</tt>. The following normalizations
128
- are active:
129
- * edit = update
130
- * show = list = view = read
131
- * delete = remove = destroy
132
-
133
- === Complex permissions (with parameters)
134
-
135
- *allow* and *deny* can also take a block that may return +true+ or +false+
136
- indicating if this really applies. So
137
- permission :pull_april_fools_prank do
138
- allow :everyone do
139
- Date.today.month == 4 and Date.today.day == 1
140
- end
141
- end
142
- will generate a <tt>may_pull_april_fools_prank?</tt> method that only returns true on
143
- April 1.
144
-
145
- This becomes more useful if you pass parameters to a <tt>may_...?</tt> method, which
146
- are passed through to the permission block (together with the user object). This
147
- way you can define more complex permissions like
148
- permission :edit_post do |current_user, post|
149
- allow :registered_user do
150
- post.owner == current_user
151
- end
152
- allow :admin
153
- end
154
- which will permit admins and post owners to edit posts.
155
-
156
- === For your convenience
157
-
158
- As a convenience, if you create a permission ending in a plural 's', this
159
- automatically includes the singular form. That is, after
160
- permission :read_posts do
161
- allow :everyone
162
- end
163
- <tt>.may_read_post? @post</tt> will return true, as well.
164
-
165
- If you want to grant +create_something+, +read_something+, +update_something+
166
- and +destroy_something+ permissions all at once, just use
167
- permission :crud_something do
168
- allow :admin
169
- end
170
-
171
- If several permission blocks (or several allow and denies) apply to a certain
172
- role, the later one always wins. That is
173
- permission :do_something do
174
- deny :everyone
175
- allow :admin
176
- end
177
- will work as expected.
178
-
179
- === Our stance on multiple roles per user
180
-
181
- We believe that you should only distinguish roles that have different ways of resolving their permissions. A typical set of roles would be
182
-
183
- * anonymous guest (has access to nothing with some exceptions)
184
- * signed up user (has access to some things depending on its attributes and associations)
185
- * administrator (has access to everything)
186
-
187
- We don't do multiple, parametrized roles like "leader for project #2" and "author of post #7".
188
- That would be reinventing associations. Just use a single :user role and let your permission block
189
- query regular associations and attributes.
190
-
191
- === Credits
192
-
193
- Henning Koch, Tobias Kraze
194
-
195
- {link www.makandra.de}[http://www.makandra.de/]
1
+ = Aegis - role-based permissions for your user models
2
+
3
+ Aegis allows you to manage fine-grained, complex permission for user accounts in a central place.
4
+
5
+ == Installation
6
+
7
+ Add the following to your <tt>Initializer.run</tt> block in your <tt>environment.rb</tt>:
8
+ config.gem 'thelinuxlich-aegis', :lib => 'aegis'
9
+ Then do a
10
+ sudo rake gems:install
11
+
12
+ Alternatively, use
13
+ sudo gem install thelinuxlich-aegis
14
+
15
+ == Changes in this fork
16
+ Now you can set the permission prefix with your locale(default is 'may')
17
+ Example: in locale/en.yml:
18
+ aegis:
19
+ permission_prefix: 'should'
20
+
21
+ And then you can verify authorization with current_user.should_edit_posts?
22
+
23
+ == Example
24
+
25
+ First, let's define some roles:
26
+
27
+ # app/models/permissions.rb
28
+ class Permissions < Aegis::Permissions
29
+
30
+ role :guest
31
+ role :registered_user
32
+ role :moderator
33
+ role :administrator, :default_permission => :allow
34
+
35
+ permission :edit_post do |user, post|
36
+ allow :registered_user do
37
+ post.creator == user # a registered_user can only edit his own posts
38
+ end
39
+ allow :moderator
40
+ end
41
+
42
+ permission :read_post do |post|
43
+ allow :everyone
44
+ deny :guest do
45
+ post.private? # guests may not read private posts
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+
52
+ Now we assign roles to users. For this, the users table needs to have a string
53
+ column +role_name+.
54
+
55
+ # app/models/user.rb
56
+ class User
57
+ has_role
58
+ end
59
+
60
+
61
+ These permissions may be used in views and controllers:
62
+
63
+ # app/views/posts/index.html.erb
64
+ @posts.each do |post|
65
+ <% if current_user.may_read_post? post %>
66
+ <%= render post %>
67
+ <% if current_user.may_edit_post? post %>
68
+ <%= link_to 'Edit', edit_post_path(post) %>
69
+ <% end %>
70
+ <% end %>
71
+ <% end %>
72
+
73
+
74
+ # app/controllers/posts_controller.rb
75
+ class PostsController
76
+ # ...
77
+
78
+ def update
79
+ @post = Post.find(params[:id])
80
+ current_user.may_edit_post! @post # raises an Aegis::PermissionError for unauthorized access
81
+ # ...
82
+ end
83
+
84
+ end
85
+
86
+ == Details
87
+
88
+ === Roles
89
+
90
+ To equip a (user) model with any permissions, you simply call *has_role* within
91
+ the model:
92
+ class User < ActiveRecord::Base
93
+ has_role
94
+ end
95
+ Aegis assumes that the corresponding database table has a string-valued column
96
+ called +role_name+. You may override the name with the <tt>:name_accessor =>
97
+ :my_role_column</tt> option.
98
+
99
+ You can define a default role for a model by saying
100
+ class User < ActiveRecord::Base
101
+ has_role :default => :admin
102
+ end
103
+ All this will do, is initialize the +role_name+ with the given default when
104
+ <tt>User.new</tt> is called.
105
+
106
+ The roles and permissions themselves are defined in a class inheriting from
107
+ <b>Aegis::Permissions</b>. To define roles you create a model <tt>permissions.rb</tt>
108
+ and use the *role* method:
109
+ class Permissions < Aegis::Permissions
110
+ role 'role_name'
111
+ end
112
+
113
+ By default, users belonging to this role are not permitted anything. You may
114
+ override this with <tt>:default_permission => :allow</tt>, e.g.
115
+ role 'admin', :default_permission => :allow
116
+
117
+ === Permissions
118
+
119
+ Permissions are specified with the *permission* method and *allow* and *deny*
120
+ permission :do_something do
121
+ allow :role_a, :role_b
122
+ deny :role_c
123
+ end
124
+
125
+ Your user model just received two methods called <b>User#may_do_something?</b>
126
+ and <b>User#may_do_something!</b>. The first one with the ? returns true for users with
127
+ +role_a+ and +role_b+, and false for users with +role_c+. The second one with the ! raises an
128
+ Aegis::PermissionError for +role_c+.
129
+
130
+ === Normalization
131
+
132
+ Aegis will perform some normalization. For example, the permissions
133
+ +edit_something+ and +update_something+ will be the same, each granting both
134
+ <tt>may_edit_something?</tt> and <tt>may_update_something?</tt>. The following normalizations
135
+ are active:
136
+ * edit = update
137
+ * show = list = view = read
138
+ * delete = remove = destroy
139
+
140
+ === Complex permissions (with parameters)
141
+
142
+ *allow* and *deny* can also take a block that may return +true+ or +false+
143
+ indicating if this really applies. So
144
+ permission :pull_april_fools_prank do
145
+ allow :everyone do
146
+ Date.today.month == 4 and Date.today.day == 1
147
+ end
148
+ end
149
+ will generate a <tt>may_pull_april_fools_prank?</tt> method that only returns true on
150
+ April 1.
151
+
152
+ This becomes more useful if you pass parameters to a <tt>may_...?</tt> method, which
153
+ are passed through to the permission block (together with the user object). This
154
+ way you can define more complex permissions like
155
+ permission :edit_post do |current_user, post|
156
+ allow :registered_user do
157
+ post.owner == current_user
158
+ end
159
+ allow :admin
160
+ end
161
+ which will permit admins and post owners to edit posts.
162
+
163
+ === For your convenience
164
+
165
+ As a convenience, if you create a permission ending in a plural 's', this
166
+ automatically includes the singular form. That is, after
167
+ permission :read_posts do
168
+ allow :everyone
169
+ end
170
+ <tt>.may_read_post? @post</tt> will return true, as well.
171
+
172
+ If you want to grant +create_something+, +read_something+, +update_something+
173
+ and +destroy_something+ permissions all at once, just use
174
+ permission :crud_something do
175
+ allow :admin
176
+ end
177
+
178
+ If several permission blocks (or several allow and denies) apply to a certain
179
+ role, the later one always wins. That is
180
+ permission :do_something do
181
+ deny :everyone
182
+ allow :admin
183
+ end
184
+ will work as expected.
185
+
186
+ === Our stance on multiple roles per user
187
+
188
+ We believe that you should only distinguish roles that have different ways of resolving their permissions. A typical set of roles would be
189
+
190
+ * anonymous guest (has access to nothing with some exceptions)
191
+ * signed up user (has access to some things depending on its attributes and associations)
192
+ * administrator (has access to everything)
193
+
194
+ We don't do multiple, parametrized roles like "leader for project #2" and "author of post #7".
195
+ That would be reinventing associations. Just use a single :user role and let your permission block
196
+ query regular associations and attributes.
197
+
198
+ === Credits
199
+
200
+ Henning Koch, Tobias Kraze
201
+
202
+ {link www.makandra.de}[http://www.makandra.de/]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.7
1
+ 1.1.8
@@ -1,7 +1,11 @@
1
1
  module Aegis
2
2
  module Constants
3
3
  EVERYONE_ROLE_NAME = :everyone
4
- PERMISSION_PREFIX = I18n.translate('aegis.permission_prefix',:default => 'may')
5
- CRUD_VERBS = ["create", "read", "update", "destroy"]
4
+ PERMISSION_PREFIX = I18n.translate('aegis.permission.prefix',:default => 'may')
5
+ ADMIN_PREFIX = I18n.translate('aegis.permission.admin', :default => 'admin')
6
+ CRUD_VERBS = [I18n.translate('aegis.permission.create', :default => 'create'),
7
+ I18n.translate('aegis.permission.read', :default => 'read'),
8
+ I18n.translate('aegis.permission.update', :default => 'update'),
9
+ I18n.translate('aegis.permission.destroy', :default => 'destroy')]
6
10
  end
7
11
  end
@@ -69,6 +69,14 @@ module Aegis
69
69
  end
70
70
  end
71
71
 
72
+ if options[:special_permissions]
73
+ self.class_eval do
74
+ self.has_many :special_permissions, :foreign_key => "user_id"
75
+ end
76
+ @class_name = self.class_name.underscore
77
+ SpecialPermission.class_eval "belongs_to :#{@class_name}, :foreign_key => 'user_id'"
78
+ end
79
+
72
80
  private
73
81
 
74
82
  # Delegate may_...? and may_...! methods to the user's role.
@@ -0,0 +1,32 @@
1
+ module Aegis
2
+ module PermissionFilter
3
+ def self.extended(base)
4
+ base.instance_eval do
5
+ def authorize_first!(current_user, options = {})
6
+ before_filter{authorize_action(current_user,options)}
7
+ end
8
+
9
+ protected
10
+ def authorize_action(current_user,options = {})
11
+ options = {:except => []}.merge(options)
12
+ options[:except] << "application"
13
+ return if options[:except].include? controller_name
14
+ permission_type = ""
15
+ case action_name
16
+ when "index","show"
17
+ permission_type = Aegis::Constants::CRUD_VERBS[1]
18
+ when "edit","update"
19
+ permission_type = Aegis::Constants::CRUD_VERBS[2]
20
+ when "new,","create"
21
+ permission_type = Aegis::Constants::CRUD_VERBS[0]
22
+ when "destroy"
23
+ permission_type = Aegis::Constants::CRUD_VERBS[3]
24
+ else
25
+ permission_type = action_name
26
+ end
27
+ eval "#{current_user}.#{Aegis::Constants::PERMISSION_PREFIX}_#{permission_type}_#{controller_name}?"
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -8,7 +8,7 @@ module Aegis
8
8
  extend ClassMethods
9
9
  end
10
10
  end
11
-
11
+
12
12
  module ClassMethods
13
13
 
14
14
  def role(role_name, options = {})
@@ -44,6 +44,27 @@ module Aegis
44
44
  add_split_crud_permission(permission_name, &block)
45
45
  end
46
46
  end
47
+
48
+ def restful_permissions!(options = {})
49
+ options = {:except => []}.merge(options)
50
+ options[:except] << "rails/info"
51
+ options[:except] << "rails_info"
52
+ options[:except] << "application"
53
+ controllers = ActionController::Routing.possible_controllers.select do |controller|
54
+ !options[:except].include? controller
55
+ end
56
+ controllers.each do |controller|
57
+ Aegis::Constants::CRUD_VERBS.zip(["writable","readable","updatable","deletable"]).each do |verb,filter|
58
+ permission "#{verb}_#{controller}" do |user|
59
+ allow :everyone do
60
+ user.send("#{Aegis::Constants::PERMISSION_PREFIX}_#{Aegis::Constants::ADMIN_PREFIX}_#{controller}?") ||
61
+ user.special_permissions.send(filter,controller).exists?
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+
47
68
 
48
69
  define_method "#{Aegis::Constants::PERMISSION_PREFIX}?" do |role_or_role_name, permission, *args|
49
70
  role = role_or_role_name.is_a?(Aegis::Role) ? role_or_role_name : find_role_by_name(role_or_role_name)
data/lib/aegis.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # Include hook code here
2
2
  require 'aegis/constants'
3
+ require 'rails/special_permission'
3
4
  require 'aegis/has_role'
4
5
  require 'aegis/normalization'
5
6
  require 'aegis/permission_error'
@@ -7,4 +8,5 @@ require 'aegis/permission_evaluator'
7
8
  require 'aegis/permissions'
8
9
  require 'aegis/role'
9
10
  require 'rails/active_record'
10
-
11
+ require 'rails/action_controller'
12
+ require 'aegis/permission_filter'
@@ -0,0 +1,10 @@
1
+ class AegisGenerator < Rails::Generator::Base
2
+ desc "Generate a table for special permissions with crud fields"
3
+
4
+ def manifest
5
+ record do |m|
6
+ m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => 'create_special_permissions'
7
+ end
8
+ end
9
+
10
+ end
@@ -0,0 +1,17 @@
1
+ class CreateSpecialPermissions < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :special_permissions do |t|
4
+ t.integer :user_id
5
+ t.string :permission_module
6
+ t.boolean :permission_read, :default => false
7
+ t.boolean :permission_write, :default => false
8
+ t.boolean :permission_destroy, :default => false
9
+ t.boolean :permission_update, :default => false
10
+ t.timestamps
11
+ end
12
+ end
13
+
14
+ def self.down
15
+ drop_table :special_permissions
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ ActionController::Base.class_eval do
2
+ extend Aegis::PermissionFilter
3
+ end
@@ -0,0 +1,10 @@
1
+ class SpecialPermission < ActiveRecord::Base
2
+
3
+ validates_presence_of :user_id, :permission_module
4
+ validates_uniqueness_of :permission_module, :scope => 'user_id'
5
+
6
+ named_scope :writable, lambda {|controller| {:conditions => ['permission_module = ? and permission_write = ?', controller, true]}}
7
+ named_scope :readable, lambda {|controller| {:conditions => ['permission_module = ? and permission_read = ?', controller, true]}}
8
+ named_scope :updatable, lambda {|controller| {:conditions => ['permission_module = ? and permission_update = ?', controller, true]}}
9
+ named_scope :deletable, lambda {|controller| {:conditions => ['permission_module = ? and permission_destroy = ?', controller, true]}}
10
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{thelinuxlich-aegis}
8
- s.version = "1.1.7"
8
+ s.version = "1.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["thelinuxlich"]
12
- s.date = %q{2010-03-23}
12
+ s.date = %q{2010-03-24}
13
13
  s.description = %q{Aegis is a role-based permission system, where all users are given a role. It is possible to define detailed and complex permissions for each role very easily.}
14
14
  s.email = %q{thelinuxlich@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -17,20 +17,25 @@ Gem::Specification.new do |s|
17
17
  ]
18
18
  s.files = [
19
19
  ".gitignore",
20
+ ":test",
20
21
  "MIT-LICENSE",
21
22
  "README.rdoc",
22
23
  "Rakefile",
23
24
  "VERSION",
24
- "aegis.gemspec",
25
25
  "lib/aegis.rb",
26
26
  "lib/aegis/constants.rb",
27
27
  "lib/aegis/has_role.rb",
28
28
  "lib/aegis/normalization.rb",
29
29
  "lib/aegis/permission_error.rb",
30
30
  "lib/aegis/permission_evaluator.rb",
31
+ "lib/aegis/permission_filter.rb",
31
32
  "lib/aegis/permissions.rb",
32
33
  "lib/aegis/role.rb",
34
+ "lib/generators/aegis/aegis_generator.rb",
35
+ "lib/generators/aegis/templates/migration.rb",
36
+ "lib/rails/action_controller.rb",
33
37
  "lib/rails/active_record.rb",
38
+ "lib/rails/special_permission.rb",
34
39
  "test/app_root/app/controllers/application_controller.rb",
35
40
  "test/app_root/app/models/old_soldier.rb",
36
41
  "test/app_root/app/models/permissions.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 7
9
- version: 1.1.7
8
+ - 8
9
+ version: 1.1.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - thelinuxlich
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-23 00:00:00 -03:00
17
+ date: 2010-03-24 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -28,20 +28,25 @@ extra_rdoc_files:
28
28
  - README.rdoc
29
29
  files:
30
30
  - .gitignore
31
+ - ":test"
31
32
  - MIT-LICENSE
32
33
  - README.rdoc
33
34
  - Rakefile
34
35
  - VERSION
35
- - aegis.gemspec
36
36
  - lib/aegis.rb
37
37
  - lib/aegis/constants.rb
38
38
  - lib/aegis/has_role.rb
39
39
  - lib/aegis/normalization.rb
40
40
  - lib/aegis/permission_error.rb
41
41
  - lib/aegis/permission_evaluator.rb
42
+ - lib/aegis/permission_filter.rb
42
43
  - lib/aegis/permissions.rb
43
44
  - lib/aegis/role.rb
45
+ - lib/generators/aegis/aegis_generator.rb
46
+ - lib/generators/aegis/templates/migration.rb
47
+ - lib/rails/action_controller.rb
44
48
  - lib/rails/active_record.rb
49
+ - lib/rails/special_permission.rb
45
50
  - test/app_root/app/controllers/application_controller.rb
46
51
  - test/app_root/app/models/old_soldier.rb
47
52
  - test/app_root/app/models/permissions.rb
data/aegis.gemspec DELETED
@@ -1,107 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
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 = %q{aegis}
8
- s.version = "1.1.6"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Henning Koch"]
12
- s.date = %q{2009-11-11}
13
- s.description = %q{Aegis is a role-based permission system, where all users are given a role. It is possible to define detailed and complex permissions for each role very easily.}
14
- s.email = %q{github@makandra.de}
15
- s.extra_rdoc_files = [
16
- "README.rdoc"
17
- ]
18
- s.files = [
19
- ".gitignore",
20
- "MIT-LICENSE",
21
- "README.rdoc",
22
- "Rakefile",
23
- "VERSION",
24
- "aegis.gemspec",
25
- "lib/aegis.rb",
26
- "lib/aegis/constants.rb",
27
- "lib/aegis/has_role.rb",
28
- "lib/aegis/normalization.rb",
29
- "lib/aegis/permission_error.rb",
30
- "lib/aegis/permission_evaluator.rb",
31
- "lib/aegis/permissions.rb",
32
- "lib/aegis/role.rb",
33
- "lib/rails/active_record.rb",
34
- "test/app_root/app/controllers/application_controller.rb",
35
- "test/app_root/app/models/old_soldier.rb",
36
- "test/app_root/app/models/permissions.rb",
37
- "test/app_root/app/models/soldier.rb",
38
- "test/app_root/app/models/trust_fund_kid.rb",
39
- "test/app_root/app/models/user.rb",
40
- "test/app_root/app/models/user_subclass.rb",
41
- "test/app_root/app/models/veteran_soldier.rb",
42
- "test/app_root/config/boot.rb",
43
- "test/app_root/config/database.yml",
44
- "test/app_root/config/environment.rb",
45
- "test/app_root/config/environments/in_memory.rb",
46
- "test/app_root/config/environments/mysql.rb",
47
- "test/app_root/config/environments/postgresql.rb",
48
- "test/app_root/config/environments/sqlite.rb",
49
- "test/app_root/config/environments/sqlite3.rb",
50
- "test/app_root/config/routes.rb",
51
- "test/app_root/db/migrate/20090408115228_create_users.rb",
52
- "test/app_root/db/migrate/20090429075648_create_soldiers.rb",
53
- "test/app_root/db/migrate/20091110075648_create_veteran_soldiers.rb",
54
- "test/app_root/db/migrate/20091110075649_create_trust_fund_kids.rb",
55
- "test/app_root/lib/console_with_fixtures.rb",
56
- "test/app_root/log/.gitignore",
57
- "test/app_root/script/console",
58
- "test/has_role_options_test.rb",
59
- "test/has_role_test.rb",
60
- "test/permissions_test.rb",
61
- "test/test_helper.rb",
62
- "test/validation_test.rb"
63
- ]
64
- s.homepage = %q{http://github.com/makandra/aegis}
65
- s.rdoc_options = ["--charset=UTF-8"]
66
- s.require_paths = ["lib"]
67
- s.rubygems_version = %q{1.3.5}
68
- s.summary = %q{Role-based permissions for your user models.}
69
- s.test_files = [
70
- "test/app_root/app/models/trust_fund_kid.rb",
71
- "test/app_root/app/models/veteran_soldier.rb",
72
- "test/app_root/app/models/permissions.rb",
73
- "test/app_root/app/models/soldier.rb",
74
- "test/app_root/app/models/user_subclass.rb",
75
- "test/app_root/app/models/old_soldier.rb",
76
- "test/app_root/app/models/user.rb",
77
- "test/app_root/app/controllers/application_controller.rb",
78
- "test/app_root/config/environment.rb",
79
- "test/app_root/config/environments/mysql.rb",
80
- "test/app_root/config/environments/postgresql.rb",
81
- "test/app_root/config/environments/sqlite3.rb",
82
- "test/app_root/config/environments/in_memory.rb",
83
- "test/app_root/config/environments/sqlite.rb",
84
- "test/app_root/config/boot.rb",
85
- "test/app_root/config/routes.rb",
86
- "test/app_root/db/migrate/20090429075648_create_soldiers.rb",
87
- "test/app_root/db/migrate/20090408115228_create_users.rb",
88
- "test/app_root/db/migrate/20091110075649_create_trust_fund_kids.rb",
89
- "test/app_root/db/migrate/20091110075648_create_veteran_soldiers.rb",
90
- "test/app_root/lib/console_with_fixtures.rb",
91
- "test/validation_test.rb",
92
- "test/test_helper.rb",
93
- "test/has_role_options_test.rb",
94
- "test/has_role_test.rb",
95
- "test/permissions_test.rb"
96
- ]
97
-
98
- if s.respond_to? :specification_version then
99
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
100
- s.specification_version = 3
101
-
102
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
103
- else
104
- end
105
- else
106
- end
107
- end