trust 0.6.1 → 0.6.2

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.
@@ -38,6 +38,9 @@ class Trust::Controller::ResourceTest < ActiveSupport::TestCase
38
38
  end
39
39
 
40
40
  class ::Parent
41
+ def initialize(*args)
42
+
43
+ end
41
44
  end
42
45
  class ::Child < Parent; end
43
46
  class ::Baluba < Parent; end
@@ -123,15 +123,17 @@ class Trust::ControllerTest < ActiveSupport::TestCase
123
123
  end
124
124
  should 'should have default parameters' do
125
125
  resource = stub('Resource')
126
+ relation = stub('Relation')
126
127
  @controller.expects(:resource).returns(resource).at_least_once
128
+ relation.expects(:new).returns(:some_relation_instance)
129
+ resource.expects(:relation).returns(relation)
127
130
  resource.expects(:instance).returns(:instance)
128
131
  resource.expects(:parent).returns(:parent)
129
132
  Trust::Authorization.expects(:authorized?).with(:manage,:instance,:parent)
130
133
  @controller.can? :manage
131
134
  resource.expects(:instance).returns(nil)
132
- resource.expects(:klass).returns(:klass)
133
135
  resource.expects(:parent).returns(:parent)
134
- Trust::Authorization.expects(:authorized?).with(:manage,:klass,:parent)
136
+ Trust::Authorization.expects(:authorized?).with(:manage,:some_relation_instance,:parent)
135
137
  @controller.can? :manage
136
138
  end
137
139
  should 'be exposed as helper' do
metadata CHANGED
@@ -1,54 +1,63 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: trust
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.2
4
5
  prerelease:
5
- version: 0.6.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Patrick Hanevold
9
9
  - Knut I Stenmark
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2012-07-20 00:00:00 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
13
+ date: 2012-07-31 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
17
16
  name: rails
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
23
22
  version: 3.0.1
24
23
  type: :runtime
25
24
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 3.0.1
31
+ - !ruby/object:Gem::Dependency
28
32
  name: sqlite3
29
- requirement: &id002 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
30
34
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
35
39
  type: :development
36
40
  prerelease: false
37
- version_requirements: *id002
38
- description: |
39
- Trust is a resource oriented framework for authorization control. It has a loose coupling from the models, and features a native
40
- Ruby implementation language. Support for inheritance and namespaced models as well as nested routes. Even permissions scheme supports inheritance.
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ description: ! 'Trust is a resource oriented framework for authorization control.
48
+ It has a loose coupling from the models, and features a native
49
+
50
+ Ruby implementation language. Support for inheritance and namespaced models as well
51
+ as nested routes. Even permissions scheme supports inheritance.
41
52
 
42
- email:
53
+ '
54
+ email:
43
55
  - patrick.hanevold@gmail.com
44
56
  - knut.stenmark@gmail.com
45
57
  executables: []
46
-
47
58
  extensions: []
48
-
49
59
  extra_rdoc_files: []
50
-
51
- files:
60
+ files:
52
61
  - lib/tasks/trust_tasks.rake
53
62
  - lib/trust/active_record.rb
54
63
  - lib/trust/authorization.rb
@@ -142,7 +151,6 @@ files:
142
151
  - test/dummy/db/migrate/20120523144144_create_clients.rb
143
152
  - test/dummy/db/schema.rb
144
153
  - test/dummy/db/test.sqlite3
145
- - test/dummy/log/development.log
146
154
  - test/dummy/log/test.log
147
155
  - test/dummy/public/404.html
148
156
  - test/dummy/public/422.html
@@ -177,38 +185,35 @@ files:
177
185
  - test/unit/trust/permissions_test.rb
178
186
  homepage: https://github.com/teknobingo/trust
179
187
  licenses: []
180
-
181
188
  post_install_message:
182
189
  rdoc_options: []
183
-
184
- require_paths:
190
+ require_paths:
185
191
  - lib
186
- required_ruby_version: !ruby/object:Gem::Requirement
192
+ required_ruby_version: !ruby/object:Gem::Requirement
187
193
  none: false
188
- requirements:
189
- - - ">="
190
- - !ruby/object:Gem::Version
191
- hash: -4478100999703184470
192
- segments:
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ segments:
193
199
  - 0
194
- version: "0"
195
- required_rubygems_version: !ruby/object:Gem::Requirement
200
+ hash: 1474495401818819639
201
+ required_rubygems_version: !ruby/object:Gem::Requirement
196
202
  none: false
197
- requirements:
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- hash: -4478100999703184470
201
- segments:
203
+ requirements:
204
+ - - ! '>='
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ segments:
202
208
  - 0
203
- version: "0"
209
+ hash: 1474495401818819639
204
210
  requirements: []
205
-
206
211
  rubyforge_project:
207
212
  rubygems_version: 1.8.24
208
213
  signing_key:
209
214
  specification_version: 3
210
215
  summary: Trust is a framework for authorization control in RubyOnRails
211
- test_files:
216
+ test_files:
212
217
  - test/dummy/app/assets/javascripts/accounts.js
213
218
  - test/dummy/app/assets/javascripts/application.js
214
219
  - test/dummy/app/assets/javascripts/clients.js
@@ -287,7 +292,6 @@ test_files:
287
292
  - test/dummy/db/migrate/20120523144144_create_clients.rb
288
293
  - test/dummy/db/schema.rb
289
294
  - test/dummy/db/test.sqlite3
290
- - test/dummy/log/development.log
291
295
  - test/dummy/log/test.log
292
296
  - test/dummy/public/404.html
293
297
  - test/dummy/public/422.html
@@ -1,39 +0,0 @@
1
-  (0.2ms) select sqlite_version(*)
2
-  (3.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
3
-  (0.0ms) PRAGMA index_list("schema_migrations")
4
-  (2.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
6
- Migrating to CreateAccounts (20120522115011)
7
-  (0.0ms) begin transaction
8
-  (0.5ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "type" varchar(255), "client_id" integer, "created_by_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
9
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120522115011')
10
-  (3.3ms) commit transaction
11
- Migrating to CreateUsers (20120522130322)
12
-  (0.0ms) begin transaction
13
-  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
14
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120522130322')
15
-  (3.1ms) commit transaction
16
- Migrating to CreateClients (20120523144144)
17
-  (0.0ms) begin transaction
18
-  (0.4ms) CREATE TABLE "clients" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "accountant_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
19
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120523144144')
20
-  (2.8ms) commit transaction
21
-  (0.3ms) select sqlite_version(*)
22
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
23
-  (0.0ms) PRAGMA index_list("accounts")
24
-  (0.0ms) PRAGMA index_list("clients")
25
-  (0.0ms) PRAGMA index_list("users")
26
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
27
-  (0.3ms) select sqlite_version(*)
28
-  (2.4ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "type" varchar(255), "client_id" integer, "created_by_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
29
-  (1.9ms) CREATE TABLE "clients" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "accountant_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
30
-  (1.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
31
-  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
32
-  (0.0ms) PRAGMA index_list("schema_migrations")
33
-  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
34
-  (0.1ms) SELECT version FROM "schema_migrations"
35
-  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20120523144144')
36
-  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20120522115011')
37
-  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20120522130322')
38
- Connecting to database specified by database.yml
39
- MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.