aegis 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -4
- data/VERSION +1 -1
- data/aegis.gemspec +11 -8
- data/lib/aegis/loader.rb +26 -0
- data/lib/aegis.rb +7 -0
- data/spec/loader_spec.rb +20 -0
- metadata +20 -10
data/README.rdoc
CHANGED
@@ -42,7 +42,7 @@ You can now check if a user has permission to access a given action in your cont
|
|
42
42
|
|
43
43
|
You can protect all actions in a controller through an Aegis resource with a single line:
|
44
44
|
|
45
|
-
class ProjectsController
|
45
|
+
class ProjectsController < ApplicationController
|
46
46
|
permissions :projects
|
47
47
|
end
|
48
48
|
|
@@ -50,7 +50,7 @@ You can protect all actions in a controller through an Aegis resource with a sin
|
|
50
50
|
== Further reading
|
51
51
|
|
52
52
|
You are now familiar with the basic use case. Aegis can do a *lot* more than that.
|
53
|
-
There is an awesome {documentation wiki}[http://wiki.github.com/makandra/aegis/] with
|
53
|
+
There is an awesome {documentation wiki}[http://wiki.github.com/makandra/aegis/] with detailed information on many basic and advanced topics, including:
|
54
54
|
|
55
55
|
* {Defining roles and basic permissions}[http://wiki.github.com/makandra/aegis/defining-roles-and-basic-permissions]
|
56
56
|
* {Checking permissions}[http://wiki.github.com/makandra/aegis/checking-permissions]
|
@@ -70,12 +70,11 @@ There is an awesome {documentation wiki}[http://wiki.github.com/makandra/aegis/]
|
|
70
70
|
== Installation
|
71
71
|
|
72
72
|
Add the following to your <tt>Initializer.run</tt> block in your <tt>environment.rb</tt>:
|
73
|
-
config.gem 'aegis'
|
73
|
+
config.gem 'aegis'
|
74
74
|
Then do a
|
75
75
|
sudo rake gems:install
|
76
76
|
|
77
77
|
Alternatively, use
|
78
|
-
sudo gem sources -a http://gemcutter.org
|
79
78
|
sudo gem install aegis
|
80
79
|
|
81
80
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
data/aegis.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{aegis}
|
8
|
-
s.version = "2.0.
|
8
|
+
s.version = "2.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Henning Koch", "Tobias Kraze"]
|
12
|
-
s.date = %q{2010-05-
|
12
|
+
s.date = %q{2010-05-09}
|
13
13
|
s.description = %q{Aegis is an authorization solution for Ruby on Rails that supports roles and a RESTish, resource-style declaration of permission rules.}
|
14
14
|
s.email = %q{henning.koch@makandra.de}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"lib/aegis/action.rb",
|
28
28
|
"lib/aegis/compiler.rb",
|
29
29
|
"lib/aegis/has_role.rb",
|
30
|
+
"lib/aegis/loader.rb",
|
30
31
|
"lib/aegis/parser.rb",
|
31
32
|
"lib/aegis/permissions.rb",
|
32
33
|
"lib/aegis/resource.rb",
|
@@ -58,6 +59,7 @@ Gem::Specification.new do |s|
|
|
58
59
|
"spec/app_root/script/console",
|
59
60
|
"spec/controllers/reviews_controller_spec.rb",
|
60
61
|
"spec/has_role_spec.rb",
|
62
|
+
"spec/loader_spec.rb",
|
61
63
|
"spec/permissions_spec.rb",
|
62
64
|
"spec/rcov.opts",
|
63
65
|
"spec/spec.opts",
|
@@ -66,15 +68,15 @@ Gem::Specification.new do |s|
|
|
66
68
|
s.homepage = %q{http://github.com/makandra/aegis}
|
67
69
|
s.rdoc_options = ["--charset=UTF-8"]
|
68
70
|
s.require_paths = ["lib"]
|
69
|
-
s.rubygems_version = %q{1.3.
|
71
|
+
s.rubygems_version = %q{1.3.6}
|
70
72
|
s.summary = %q{Complete authorization solution for Rails}
|
71
73
|
s.test_files = [
|
72
|
-
"spec/app_root/app/
|
74
|
+
"spec/app_root/app/controllers/application_controller.rb",
|
75
|
+
"spec/app_root/app/controllers/reviews_controller.rb",
|
76
|
+
"spec/app_root/app/models/permissions.rb",
|
73
77
|
"spec/app_root/app/models/property.rb",
|
74
78
|
"spec/app_root/app/models/review.rb",
|
75
|
-
"spec/app_root/app/models/
|
76
|
-
"spec/app_root/app/controllers/application_controller.rb",
|
77
|
-
"spec/app_root/app/controllers/reviews_controller.rb",
|
79
|
+
"spec/app_root/app/models/user.rb",
|
78
80
|
"spec/app_root/config/boot.rb",
|
79
81
|
"spec/app_root/config/environment.rb",
|
80
82
|
"spec/app_root/config/environments/in_memory.rb",
|
@@ -88,10 +90,11 @@ Gem::Specification.new do |s|
|
|
88
90
|
"spec/app_root/db/migrate/003_create_reviews.rb",
|
89
91
|
"spec/app_root/lib/console_with_fixtures.rb",
|
90
92
|
"spec/action_controller_spec.rb",
|
93
|
+
"spec/controllers/reviews_controller_spec.rb",
|
91
94
|
"spec/has_role_spec.rb",
|
92
95
|
"spec/permissions_spec.rb",
|
93
96
|
"spec/spec_helper.rb",
|
94
|
-
"spec/
|
97
|
+
"spec/loader_spec.rb"
|
95
98
|
]
|
96
99
|
|
97
100
|
if s.respond_to? :specification_version then
|
data/lib/aegis/loader.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
class Aegis::Loader
|
2
|
+
class << self
|
3
|
+
|
4
|
+
def paths
|
5
|
+
[ 'aegis/access_denied',
|
6
|
+
'aegis/action',
|
7
|
+
'aegis/compiler',
|
8
|
+
'aegis/has_role',
|
9
|
+
'aegis/parser',
|
10
|
+
'aegis/permissions',
|
11
|
+
'aegis/resource',
|
12
|
+
'aegis/role',
|
13
|
+
'aegis/sieve',
|
14
|
+
|
15
|
+
'rails/action_controller',
|
16
|
+
'rails/active_record' ]
|
17
|
+
end
|
18
|
+
|
19
|
+
def load
|
20
|
+
for path in paths
|
21
|
+
require path
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
data/lib/aegis.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
|
3
|
+
#for file in Dir["#{File.dirname(__FILE__)}/*/*.rb"]
|
4
|
+
# p file
|
5
|
+
#end
|
6
|
+
|
7
|
+
# Dir["#{File.dirname(__FILE__)}/**/*.rb"].each {|f| require f}
|
8
|
+
|
9
|
+
require 'aegis/loader'
|
3
10
|
require 'aegis/access_denied'
|
4
11
|
require 'aegis/action'
|
5
12
|
require 'aegis/compiler'
|
data/spec/loader_spec.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
|
+
|
3
|
+
describe Aegis::Loader do
|
4
|
+
|
5
|
+
describe 'paths' do
|
6
|
+
|
7
|
+
it "should return all paths in the lib folder" do
|
8
|
+
|
9
|
+
root = "#{File.dirname(__FILE__)}/../lib/"
|
10
|
+
expected_paths = Dir["#{root}*/*.rb"].collect do |file|
|
11
|
+
file.sub(root, "").sub(/\.rb$/, "")
|
12
|
+
end - ['aegis/loader']
|
13
|
+
|
14
|
+
Aegis::Loader.paths.should =~ expected_paths
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aegis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 2
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 2.0.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Henning Koch
|
@@ -10,7 +15,7 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2010-05-
|
18
|
+
date: 2010-05-09 00:00:00 +02:00
|
14
19
|
default_executable:
|
15
20
|
dependencies: []
|
16
21
|
|
@@ -34,6 +39,7 @@ files:
|
|
34
39
|
- lib/aegis/action.rb
|
35
40
|
- lib/aegis/compiler.rb
|
36
41
|
- lib/aegis/has_role.rb
|
42
|
+
- lib/aegis/loader.rb
|
37
43
|
- lib/aegis/parser.rb
|
38
44
|
- lib/aegis/permissions.rb
|
39
45
|
- lib/aegis/resource.rb
|
@@ -65,6 +71,7 @@ files:
|
|
65
71
|
- spec/app_root/script/console
|
66
72
|
- spec/controllers/reviews_controller_spec.rb
|
67
73
|
- spec/has_role_spec.rb
|
74
|
+
- spec/loader_spec.rb
|
68
75
|
- spec/permissions_spec.rb
|
69
76
|
- spec/rcov.opts
|
70
77
|
- spec/spec.opts
|
@@ -82,28 +89,30 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
89
|
requirements:
|
83
90
|
- - ">="
|
84
91
|
- !ruby/object:Gem::Version
|
92
|
+
segments:
|
93
|
+
- 0
|
85
94
|
version: "0"
|
86
|
-
version:
|
87
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
96
|
requirements:
|
89
97
|
- - ">="
|
90
98
|
- !ruby/object:Gem::Version
|
99
|
+
segments:
|
100
|
+
- 0
|
91
101
|
version: "0"
|
92
|
-
version:
|
93
102
|
requirements: []
|
94
103
|
|
95
104
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.3.
|
105
|
+
rubygems_version: 1.3.6
|
97
106
|
signing_key:
|
98
107
|
specification_version: 3
|
99
108
|
summary: Complete authorization solution for Rails
|
100
109
|
test_files:
|
101
|
-
- spec/app_root/app/models/user.rb
|
102
|
-
- spec/app_root/app/models/property.rb
|
103
|
-
- spec/app_root/app/models/review.rb
|
104
|
-
- spec/app_root/app/models/permissions.rb
|
105
110
|
- spec/app_root/app/controllers/application_controller.rb
|
106
111
|
- spec/app_root/app/controllers/reviews_controller.rb
|
112
|
+
- spec/app_root/app/models/permissions.rb
|
113
|
+
- spec/app_root/app/models/property.rb
|
114
|
+
- spec/app_root/app/models/review.rb
|
115
|
+
- spec/app_root/app/models/user.rb
|
107
116
|
- spec/app_root/config/boot.rb
|
108
117
|
- spec/app_root/config/environment.rb
|
109
118
|
- spec/app_root/config/environments/in_memory.rb
|
@@ -117,7 +126,8 @@ test_files:
|
|
117
126
|
- spec/app_root/db/migrate/003_create_reviews.rb
|
118
127
|
- spec/app_root/lib/console_with_fixtures.rb
|
119
128
|
- spec/action_controller_spec.rb
|
129
|
+
- spec/controllers/reviews_controller_spec.rb
|
120
130
|
- spec/has_role_spec.rb
|
121
131
|
- spec/permissions_spec.rb
|
122
132
|
- spec/spec_helper.rb
|
123
|
-
- spec/
|
133
|
+
- spec/loader_spec.rb
|