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.
- data/lib/trust/controller.rb +1 -1
- data/lib/trust/version.rb +1 -1
- data/test/dummy/log/test.log +2498 -2715
- data/test/unit/trust/controller/resource_test.rb +3 -0
- data/test/unit/trust/controller_test.rb +4 -2
- metadata +53 -49
- data/test/dummy/log/development.log +0 -39
@@ -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,:
|
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
|
-
|
15
|
-
|
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:
|
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:
|
27
|
-
|
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:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
30
34
|
none: false
|
31
|
-
requirements:
|
32
|
-
- -
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
35
39
|
type: :development
|
36
40
|
prerelease: false
|
37
|
-
version_requirements:
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
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
|
-
|
192
|
-
segments:
|
194
|
+
requirements:
|
195
|
+
- - ! '>='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
segments:
|
193
199
|
- 0
|
194
|
-
|
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
|
-
|
201
|
-
segments:
|
203
|
+
requirements:
|
204
|
+
- - ! '>='
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '0'
|
207
|
+
segments:
|
202
208
|
- 0
|
203
|
-
|
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
|
-
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
2
|
-
[1m[35m (3.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
3
|
-
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
4
|
-
[1m[35m (2.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
6
|
-
Migrating to CreateAccounts (20120522115011)
|
7
|
-
[1m[35m (0.0ms)[0m begin transaction
|
8
|
-
[1m[36m (0.5ms)[0m [1mCREATE 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) [0m
|
9
|
-
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20120522115011')
|
10
|
-
[1m[36m (3.3ms)[0m [1mcommit transaction[0m
|
11
|
-
Migrating to CreateUsers (20120522130322)
|
12
|
-
[1m[35m (0.0ms)[0m begin transaction
|
13
|
-
[1m[36m (0.4ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
14
|
-
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20120522130322')
|
15
|
-
[1m[36m (3.1ms)[0m [1mcommit transaction[0m
|
16
|
-
Migrating to CreateClients (20120523144144)
|
17
|
-
[1m[35m (0.0ms)[0m begin transaction
|
18
|
-
[1m[36m (0.4ms)[0m [1mCREATE 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) [0m
|
19
|
-
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20120523144144')
|
20
|
-
[1m[36m (2.8ms)[0m [1mcommit transaction[0m
|
21
|
-
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
22
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23
|
-
[1m[35m (0.0ms)[0m PRAGMA index_list("accounts")
|
24
|
-
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("clients")[0m
|
25
|
-
[1m[35m (0.0ms)[0m PRAGMA index_list("users")
|
26
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
27
|
-
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
28
|
-
[1m[36m (2.4ms)[0m [1mCREATE 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) [0m
|
29
|
-
[1m[35m (1.9ms)[0m 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
|
-
[1m[36m (1.8ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
31
|
-
[1m[35m (1.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
32
|
-
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
33
|
-
[1m[35m (1.7ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
34
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
35
|
-
[1m[35m (1.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120523144144')
|
36
|
-
[1m[36m (1.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120522115011')[0m
|
37
|
-
[1m[35m (1.9ms)[0m 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.
|