cantango 0.8.0 → 0.8.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +32 -19
- data/README.textile +79 -131
- data/VERSION +1 -1
- data/cantango.gemspec +94 -61
- data/lib/cantango.rb +4 -6
- data/lib/cantango/ability.rb +28 -17
- data/lib/cantango/ability/cache.rb +30 -60
- data/lib/cantango/ability/cache/base_cache.rb +1 -1
- data/lib/cantango/ability/cache/key.rb +39 -0
- data/lib/cantango/ability/cache/kompiler.rb +22 -6
- data/lib/cantango/ability/cache/moneta_cache.rb +1 -1
- data/lib/cantango/ability/cache/reader.rb +32 -0
- data/lib/cantango/ability/cache/rules_cache.rb +31 -0
- data/lib/cantango/ability/cache/session_cache.rb +3 -2
- data/lib/cantango/ability/cache/writer.rb +42 -0
- data/lib/cantango/ability/cache_helpers.rb +28 -0
- data/lib/cantango/ability/masquerade_helpers.rb +7 -2
- data/lib/cantango/ability/permission_helpers.rb +0 -8
- data/lib/cantango/ability/permit_helpers.rb +0 -17
- data/lib/cantango/ability/role_helpers.rb +0 -2
- data/lib/cantango/ability/user_helpers.rb +1 -0
- data/lib/cantango/adapter/compiler.rb +9 -0
- data/lib/cantango/adapter/moneta.rb +23 -0
- data/lib/cantango/api.rb +1 -1
- data/lib/cantango/api/aliases.rb +4 -8
- data/lib/cantango/api/attributes.rb +17 -0
- data/lib/cantango/api/common.rb +6 -0
- data/lib/cantango/api/options.rb +9 -5
- data/lib/cantango/cache.rb +1 -1
- data/lib/cantango/cache/hash_cache.rb +34 -0
- data/lib/cantango/configuration.rb +13 -8
- data/lib/cantango/configuration/adapters.rb +25 -0
- data/lib/cantango/configuration/categories.rb +3 -1
- data/lib/cantango/configuration/engines.rb +83 -11
- data/lib/cantango/configuration/engines/cache.rb +12 -1
- data/lib/cantango/configuration/engines/engine.rb +5 -5
- data/lib/cantango/configuration/engines/permission.rb +1 -1
- data/lib/cantango/configuration/permit_registry.rb +17 -0
- data/lib/cantango/configuration/permits.rb +29 -0
- data/lib/cantango/configuration/registry.rb +5 -2
- data/lib/cantango/configuration/role_groups.rb +3 -0
- data/lib/cantango/configuration/role_registry.rb +4 -0
- data/lib/cantango/configuration/roles.rb +2 -0
- data/lib/cantango/configuration/user_accounts.rb +1 -0
- data/lib/cantango/configuration/users.rb +1 -0
- data/lib/cantango/engine.rb +13 -0
- data/lib/cantango/filters.rb +5 -0
- data/lib/cantango/filters/filter.rb +34 -0
- data/lib/cantango/filters/role_filter.rb +29 -0
- data/lib/cantango/filters/role_group_filter.rb +28 -0
- data/lib/cantango/permission_engine.rb +26 -1
- data/lib/cantango/permission_engine/collector.rb +7 -2
- data/lib/cantango/permission_engine/compiler.rb +8 -1
- data/lib/cantango/permission_engine/evaluator.rb +2 -2
- data/lib/cantango/permission_engine/factory.rb +8 -12
- data/lib/cantango/permission_engine/loader.rb +1 -1
- data/lib/cantango/permission_engine/loader/base.rb +1 -1
- data/lib/cantango/permission_engine/loader/categories.rb +3 -3
- data/lib/cantango/permission_engine/loader/permissions.rb +8 -5
- data/lib/cantango/permission_engine/moneta_store.rb +2 -2
- data/lib/cantango/permission_engine/parser.rb +1 -1
- data/lib/cantango/permission_engine/parser/categories.rb +1 -1
- data/lib/cantango/permission_engine/parser/category.rb +1 -1
- data/lib/cantango/permission_engine/parser/default.rb +1 -2
- data/lib/cantango/permission_engine/parser/ownership.rb +1 -1
- data/lib/cantango/permission_engine/parser/permissions.rb +1 -1
- data/lib/cantango/permission_engine/parser/regex.rb +2 -2
- data/lib/cantango/permission_engine/parser/relationship.rb +1 -1
- data/lib/cantango/permission_engine/parser/rule.rb +1 -1
- data/lib/cantango/permission_engine/permission.rb +2 -2
- data/lib/cantango/permission_engine/selector.rb +3 -3
- data/lib/cantango/permission_engine/selector/account_types.rb +24 -0
- data/lib/cantango/permission_engine/selector/base.rb +3 -3
- data/lib/cantango/permission_engine/selector/licenses.rb +2 -2
- data/lib/cantango/permission_engine/selector/role_groups.rb +7 -6
- data/lib/cantango/permission_engine/selector/roles.rb +10 -6
- data/lib/cantango/permission_engine/selector/user_types.rb +23 -0
- data/lib/cantango/permission_engine/selector/users.rb +2 -2
- data/lib/cantango/permission_engine/statement.rb +10 -9
- data/lib/cantango/permission_engine/statements.rb +27 -25
- data/lib/cantango/permission_engine/store.rb +1 -1
- data/lib/cantango/permission_engine/yaml_store.rb +2 -2
- data/lib/cantango/permit_engine.rb +29 -4
- data/lib/cantango/permit_engine/builder.rb +2 -3
- data/lib/cantango/permit_engine/builder/base.rb +9 -1
- data/lib/cantango/permit_engine/builder/special_permits.rb +7 -8
- data/lib/cantango/permit_engine/compatibility.rb +1 -1
- data/lib/cantango/permit_engine/executor.rb +1 -1
- data/lib/cantango/permit_engine/executor/abstract.rb +1 -1
- data/lib/cantango/permit_engine/executor/base.rb +1 -1
- data/lib/cantango/permit_engine/executor/system.rb +1 -1
- data/lib/cantango/permit_engine/factory.rb +2 -7
- data/lib/cantango/permit_engine/finder.rb +43 -9
- data/lib/cantango/permit_engine/role_matcher.rb +1 -1
- data/lib/cantango/permit_engine/util.rb +2 -1
- data/lib/cantango/permits.rb +9 -0
- data/lib/cantango/{permit_engine → permits}/account_permit.rb +15 -4
- data/lib/cantango/{permit_engine → permits}/account_permit/builder.rb +2 -6
- data/lib/cantango/{permit_engine → permits}/account_permit/finder.rb +2 -2
- data/lib/cantango/{permit_engine → permits}/license.rb +1 -1
- data/lib/cantango/{permit_engine → permits}/license/loader.rb +1 -1
- data/lib/cantango/{permit_engine → permits}/license/rules.rb +1 -1
- data/lib/cantango/permits/macros.rb +19 -0
- data/lib/cantango/{permit_engine → permits}/permit.rb +13 -1
- data/lib/cantango/{permit_engine → permits}/role_group_permit.rb +15 -3
- data/lib/cantango/{permit_engine → permits}/role_group_permit/builder.rb +10 -22
- data/lib/cantango/{permit_engine → permits}/role_group_permit/finder.rb +2 -2
- data/lib/cantango/{permit_engine → permits}/role_permit.rb +15 -3
- data/lib/cantango/permits/role_permit/builder.rb +27 -0
- data/lib/cantango/{permit_engine → permits}/role_permit/finder.rb +2 -2
- data/lib/cantango/{permit_engine → permits}/user_permit.rb +15 -3
- data/lib/cantango/{permit_engine → permits}/user_permit/builder.rb +2 -6
- data/lib/cantango/{permit_engine → permits}/user_permit/finder.rb +2 -2
- data/lib/cantango/rails.rb +3 -1
- data/lib/cantango/rails/engine.rb +11 -6
- data/lib/cantango/rails/helpers/base_helper.rb +28 -0
- data/lib/cantango/rails/helpers/controller_helper.rb +17 -0
- data/lib/cantango/rails/helpers/rest_helper.rb +44 -0
- data/lib/cantango/rails/helpers/view_helper.rb +17 -0
- data/lib/cantango/rails/railtie.rb +1 -1
- data/lib/cantango/rspec/config.rb +1 -1
- data/lib/cantango/rspec/matchers/be_allowed_to.rb +5 -3
- data/lib/cantango/rules/user_relation.rb +1 -1
- data/lib/cantango/users/macros.rb +8 -2
- data/lib/cantango/users/user.rb +1 -1
- data/lib/generators/cantango/account_permit/account_permit_generator.rb +37 -0
- data/lib/generators/cantango/account_permit/templates/account_permit.erb +13 -0
- data/lib/generators/cantango/base.rb +15 -18
- data/lib/generators/cantango/basic.rb +41 -0
- data/lib/generators/cantango/install/install_generator.rb +37 -0
- data/lib/generators/cantango/install/templates/cantango.rb +4 -0
- data/{spec/active_record/scenarios/user_accounts/config/account_permits.yml → lib/generators/cantango/install/templates/categories.yml} +0 -0
- data/lib/generators/cantango/install/templates/permissions.yml +4 -0
- data/lib/generators/cantango/license/license_generator.rb +6 -11
- data/lib/generators/cantango/license/templates/license.erb +1 -1
- data/lib/generators/cantango/license_base.rb +2 -2
- data/lib/generators/cantango/licenses/licenses_generator.rb +2 -7
- data/lib/generators/cantango/permit_generator.rb +31 -10
- data/lib/generators/cantango/role_permit/role_permit_generator.rb +11 -14
- data/lib/generators/cantango/role_permit/templates/account_permit.erb +2 -2
- data/lib/generators/cantango/role_permit/templates/role_group_permit.erb +2 -2
- data/lib/generators/cantango/role_permit/templates/role_permit.erb +2 -2
- data/lib/generators/cantango/role_permits/role_permits_generator.rb +16 -98
- data/lib/generators/cantango/user_permit/templates/account_permit.erb +5 -0
- data/lib/generators/cantango/user_permit/templates/user_permit.erb +13 -0
- data/lib/generators/cantango/user_permit/user_permit_generator.rb +36 -0
- data/spec/TODO +1 -6
- data/spec/active_record/helper/permits_config.rb +1 -1
- data/spec/active_record/scenarios/engines/permission_engine/{cantango_permissions.yml → permissions.yml} +2 -1
- data/spec/active_record/scenarios/engines/permission_engine/tango_permission_yml_spec.rb +8 -9
- data/spec/active_record/scenarios/engines/permit_engine/licenses_spec.rb +2 -2
- data/spec/active_record/scenarios/engines/permit_engine/role_groups_permits_spec.rb +2 -2
- data/spec/active_record/scenarios/shared/{can_tango.rb → cantango.rb} +1 -1
- data/spec/active_record/scenarios/shared/models/items.rb +0 -1
- data/spec/active_record/scenarios/shared/models/users.rb +6 -1
- data/spec/active_record/spec_helper.rb +6 -4
- data/spec/cantango/ability/cache/key_spec.rb +64 -0
- data/spec/cantango/ability/cache/{compiler_spec.rb → kompiler_spec.rb} +9 -21
- data/spec/cantango/ability/cache/reader_compile_spec.rb +42 -0
- data/spec/cantango/ability/cache/reader_spec.rb +33 -0
- data/spec/cantango/ability/cache/rules_cache_spec.rb +15 -0
- data/spec/cantango/ability/cache/session_cache_spec.rb +1 -1
- data/spec/cantango/ability/cache/writer_spec.rb +21 -0
- data/spec/cantango/ability/cache_spec.rb +6 -2
- data/spec/cantango/ability_filters_spec.rb +5 -10
- data/spec/cantango/ability_spec.rb +2 -3
- data/spec/cantango/api/attributes_spec.rb +27 -0
- data/spec/cantango/api/user/can_api_spec.rb +2 -2
- data/spec/cantango/api/user_account/can_api_spec.rb +2 -2
- data/spec/cantango/configuration/adapter_spec.rb +28 -0
- data/spec/cantango/configuration/engines/cache_spec.rb +2 -2
- data/spec/cantango/configuration/engines/permission_spec.rb +3 -3
- data/spec/cantango/configuration/engines/permit_spec.rb +1 -1
- data/spec/cantango/configuration/engines/store_shared.rb +3 -1
- data/spec/cantango/configuration/engines_spec.rb +106 -3
- data/spec/cantango/configuration/hash_registry_spec.rb +1 -1
- data/spec/cantango/configuration/permit_registry_spec.rb +14 -0
- data/spec/cantango/configuration/permits_spec.rb +25 -0
- data/spec/cantango/configuration/registry_spec.rb +1 -1
- data/spec/cantango/configuration/shared/registry_ex.rb +2 -1
- data/spec/cantango/configuration_spec.rb +5 -5
- data/spec/cantango/permission_engine/compiler_spec.rb +8 -0
- data/spec/cantango/permission_engine/permission_spec.rb +1 -1
- data/spec/cantango/permission_engine/yaml_store_spec.rb +14 -4
- data/spec/cantango/permission_engine_spec.rb +0 -0
- data/spec/cantango/permit_engine/account_permit_spec.rb +2 -4
- data/spec/cantango/permit_engine/builder/role_group_permits_spec.rb +4 -7
- data/spec/cantango/permit_engine/builder/role_permits_spec.rb +5 -6
- data/spec/cantango/permit_engine/builder/special_permits_spec.rb +3 -4
- data/spec/cantango/permit_engine/executor/system_spec.rb +2 -2
- data/spec/cantango/permit_engine/factory_spec.rb +2 -3
- data/spec/cantango/permit_engine/finder_spec.rb +144 -23
- data/spec/cantango/permit_engine/permit/permit_static_and_dynamic_rules_spec.rb +4 -5
- data/spec/cantango/permit_engine/role_group_permit_spec.rb +1 -1
- data/spec/cantango/permit_engine/role_permit_spec.rb +6 -7
- data/spec/cantango/permit_engine/user_permit_spec.rb +2 -3
- data/spec/cantango/permit_engine_spec.rb +2 -0
- data/spec/cantango/permits/macros_spec.rb +41 -0
- data/spec/cantango/permits/permit_spec.rb +46 -0
- data/spec/cantango_spec.rb +13 -0
- data/spec/devise-dummy/app/helpers/application_helper.rb +7 -0
- data/spec/devise-dummy/app/views/articles/admin.html.haml +1 -1
- data/spec/devise-dummy/app/views/articles/admin_account.html.haml +1 -1
- data/spec/devise-dummy/app/views/articles/guest.html.haml +1 -1
- data/spec/devise-dummy/app/views/articles/index.html.haml +1 -1
- data/spec/devise-dummy/app/views/comments/guest.html.haml +1 -1
- data/spec/devise-dummy/app/views/comments/index.html.haml +1 -1
- data/spec/devise-dummy/app/views/concertos/admin.html.haml +1 -1
- data/spec/devise-dummy/app/views/concertos/admin_account.html.haml +1 -1
- data/spec/devise-dummy/app/views/concertos/guest.html.haml +1 -1
- data/spec/devise-dummy/app/views/concertos/index.html.haml +1 -1
- data/spec/devise-dummy/app/views/users/index.html.haml +1 -1
- data/spec/devise-dummy/config/initializers/cantango.rb +3 -3
- data/spec/devise-dummy/config/{cantango_permissions.yml → permissions.yml} +2 -1
- data/spec/devise-integration/concerto_spec.rb +1 -1
- data/spec/dummy/app/models/user.rb +1 -0
- data/spec/dummy/app/views/articles/admin.html.haml +1 -1
- data/spec/dummy/app/views/articles/admin_account.html.haml +1 -1
- data/spec/dummy/app/views/articles/guest.html.haml +1 -1
- data/spec/dummy/app/views/articles/index.html.haml +1 -1
- data/spec/dummy/app/views/comments/guest.html.haml +1 -1
- data/spec/dummy/app/views/comments/index.html.haml +1 -1
- data/spec/dummy/app/views/concertos/admin.html.haml +1 -1
- data/spec/dummy/app/views/concertos/admin_account.html.haml +1 -1
- data/spec/dummy/app/views/concertos/guest.html.haml +1 -1
- data/spec/dummy/app/views/concertos/index.html.haml +1 -1
- data/spec/dummy/app/views/posts/admin.html.haml +1 -1
- data/spec/dummy/app/views/posts/admin_account.html.haml +1 -1
- data/spec/dummy/app/views/posts/guest.html.haml +1 -1
- data/spec/dummy/app/views/posts/index.html.haml +1 -1
- data/spec/dummy/app/views/users/admin.html.haml +1 -1
- data/spec/dummy/app/views/users/admin_account.html.haml +1 -1
- data/spec/dummy/app/views/users/guest.html.haml +1 -1
- data/spec/dummy/app/views/users/index.html.haml +1 -1
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/initializers/cantango.rb +1 -3
- data/spec/dummy/config/{cantango_permissions.yml → permissions.yml} +2 -2
- data/spec/dummy_spec_helper.rb +2 -0
- data/spec/entire_suite_spec.rb +2 -0
- data/spec/factories/user.rb +8 -0
- data/spec/factories/user_account.rb +6 -0
- data/spec/fixtures/config/permissions.yml +60 -19
- data/spec/fixtures/models/admin.rb +2 -0
- data/spec/fixtures/models/admin_account.rb +22 -0
- data/spec/fixtures/models/simple_roles.rb +5 -0
- data/spec/fixtures/models/user.rb +4 -0
- data/spec/helpers/dummy_app_ability.rb +2 -5
- data/spec/integration/cache_using_moneta_spec.rb +3 -1
- data/spec/integration/cache_using_session_spec.rb +2 -2
- data/spec/integration/user/articles_spec.rb +1 -1
- data/spec/integration/user/concerto_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -5
- metadata +120 -95
- data/lib/cantango/ability/class_methods.rb +0 -27
- data/lib/cantango/api/aliases/account_permit.rb +0 -8
- data/lib/cantango/api/aliases/license.rb +0 -7
- data/lib/cantango/api/aliases/permit.rb +0 -9
- data/lib/cantango/api/aliases/role_group_permit.rb +0 -7
- data/lib/cantango/api/aliases/role_permit.rb +0 -7
- data/lib/cantango/api/aliases/user_permit.rb +0 -8
- data/lib/cantango/permission_engine/builder.rb +0 -6
- data/lib/cantango/permit_engine/role_permit/builder.rb +0 -46
- data/lib/cantango/rails/base_helpers.rb +0 -26
- data/lib/cantango/rails/controller_helpers.rb +0 -15
- data/lib/cantango/rails/view_helpers.rb +0 -15
- data/spec/active_record/scenarios/shared/permits/PERMITS README.textile +0 -3
- data/spec/active_record/scenarios/user_accounts/docs/USER_ACCOUNTS_SCENARIO.textile +0 -20
- data/spec/active_record/scenarios/user_accounts/docs/basic_rules_spec_possible_samples.txt +0 -84
- data/spec/factories.rb +0 -8
- data/spec/fixtures/config/cantango_permissions.yml +0 -48
data/Gemfile
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
group :default do
|
4
|
-
gem 'rails',
|
5
|
-
gem 'cancan',
|
6
|
-
gem 'sugar-high',
|
4
|
+
gem 'rails', '>= 3.0.1'
|
5
|
+
gem 'cancan', '>= 1.4'
|
6
|
+
gem 'sugar-high', '>= 0.6.0'
|
7
|
+
gem 'sweetloader', '~> 0.1.0'
|
7
8
|
gem 'sqlite3'
|
8
|
-
gem 'hashie',
|
9
|
-
gem 'sourcify'
|
10
|
-
gem 'dkastner-moneta', '>= 1.0'
|
11
|
-
gem "friendly_id"
|
9
|
+
gem 'hashie', '>= 0.4'
|
12
10
|
|
13
11
|
# adapters
|
14
|
-
gem '
|
12
|
+
# gem 'sourcify'
|
13
|
+
# gem 'dkastner-moneta', '>= 1.0'
|
14
|
+
# gem 'meta_where'
|
15
15
|
# gem 'mongoid'
|
16
16
|
end
|
17
17
|
|
@@ -20,35 +20,48 @@ group :test do
|
|
20
20
|
|
21
21
|
# Data
|
22
22
|
gem 'database_cleaner', :git => "git://github.com/kristianmandrup/database_cleaner.git"
|
23
|
-
|
24
23
|
gem 'factory_girl'
|
25
24
|
|
25
|
+
# for later...
|
26
|
+
# gem 'meta_where'
|
27
|
+
# gem 'mongoid'
|
28
|
+
|
26
29
|
# Specs
|
27
30
|
gem 'spork'
|
28
|
-
gem "rspec-rails", '>= 2.5'
|
29
31
|
gem 'capybara'
|
30
|
-
gem 'rails-app-spec'
|
32
|
+
gem 'rails-app-spec', '>= 0.5.0'
|
31
33
|
gem 'mocha'
|
32
34
|
gem "launchy"
|
33
35
|
|
36
|
+
# Debug and performance tests
|
34
37
|
gem 'cutter'
|
35
38
|
|
36
|
-
#
|
37
|
-
gem 'haml'
|
39
|
+
# Integration testing
|
38
40
|
gem 'decent_exposure'
|
41
|
+
gem "friendly_id"
|
42
|
+
gem "devise", '>= 1.4'
|
39
43
|
|
40
|
-
#
|
41
|
-
gem
|
44
|
+
# Rails
|
45
|
+
gem 'haml'
|
42
46
|
|
43
47
|
# Generators
|
44
|
-
gem 'generator-spec'
|
48
|
+
gem 'generator-spec', '>= 0.7.8'
|
49
|
+
end
|
50
|
+
|
51
|
+
group :development, :test do
|
52
|
+
# gem 'rspec-rails', '2.6.1' # needed in development to expose the rails generators
|
53
|
+
# gem 'forgery', '0.3.10' # needed in development when using rake db:seed
|
54
|
+
gem 'factory_girl'
|
55
|
+
|
56
|
+
# Adapters
|
57
|
+
gem 'sourcify'
|
58
|
+
gem 'dkastner-moneta', '>= 1.0'
|
45
59
|
end
|
46
60
|
|
47
61
|
group :development do
|
48
|
-
gem
|
49
|
-
gem "rspec", ">= 2.5.0"
|
62
|
+
gem "rspec", ">= 2.4.0"
|
50
63
|
gem "jeweler", ">= 1.6.4"
|
51
|
-
gem "bundler", "
|
64
|
+
gem "bundler", ">= 1.0.1"
|
52
65
|
gem "rdoc"
|
53
66
|
|
54
67
|
# gem 'logging_assist'
|
data/README.textile
CHANGED
@@ -1,179 +1,127 @@
|
|
1
1
|
h1. CanTango
|
2
2
|
|
3
|
-
CanTango
|
4
|
-
permissions design. CanTango also integrates well with "Devise":https://github.com/plataformatec/devise and scenarios with multiple user accounts.
|
3
|
+
CanTango is an advanced Access Control (permissions) system for Rails 3. It:
|
5
4
|
|
6
|
-
|
5
|
+
* extends "CanCan":http://github.com/ryanb/cancan and offers a role oriented design
|
6
|
+
* integrates with _role_ and _authentication_ systems in a non-intrusive manner
|
7
|
+
* can _cache_ rules between requests for increased performance
|
8
|
+
* can _store_ rules in a permission store, including a YAML file, for easy administration
|
9
|
+
* works well with multiple user accounts and sub applications
|
10
|
+
* supports multiple "Devise":https://github.com/plataformatec/devise users
|
7
11
|
|
8
|
-
|
9
|
-
* Ruby 1.9+
|
12
|
+
h3. Will CanTango meet my Access Control (permission) requirements?
|
10
13
|
|
11
|
-
|
12
|
-
*
|
13
|
-
|
14
|
-
h2. August 15, RC4 released!
|
15
|
-
|
16
|
-
Today marks the first CanTango release, version 0.8.0.
|
17
|
-
The project includes two working dummy apps (see spec folder).
|
18
|
-
|
19
|
-
* "dummy" - how to use CanTango in a Rails 3 app without Devise.
|
20
|
-
* "devise-dummy" - integration _with_ Devise :)
|
14
|
+
* "CanCan vs CanTango":https://github.com/kristianmandrup/cantango/wiki/CanCan-vs-CanTango
|
15
|
+
* "CanTango overview":https://github.com/kristianmandrup/cantango/wiki
|
21
16
|
|
22
|
-
|
17
|
+
h2. Installation
|
23
18
|
|
24
|
-
|
19
|
+
h3. Ruby versions
|
25
20
|
|
26
|
-
|
27
|
-
|
21
|
+
CanTango has been tested to work with _Ruby 1.9+_ and currently doesn't support _Ruby 1.8.7_
|
22
|
+
If you require ruby 1.8.7 support, please help patch it and make a pull request ;)
|
28
23
|
|
29
|
-
|
24
|
+
h3. Install in current environment (or gemset)
|
30
25
|
|
31
26
|
@gem install cantango@
|
32
27
|
|
33
|
-
|
28
|
+
h3. Install in application
|
34
29
|
|
35
30
|
Insert into Gemfile
|
36
31
|
|
37
32
|
@gem 'cantango'@
|
38
33
|
|
39
|
-
Run bundler
|
34
|
+
Run bundler in a terminal/console from the folder of your Gemfile (root folder of app)
|
40
35
|
|
41
36
|
@$ bundle@
|
42
37
|
|
43
|
-
h2.
|
44
|
-
|
45
|
-
<pre>
|
46
|
-
$ bundle
|
47
|
-
|
48
|
-
# run dummy app integration specs
|
49
|
-
$ bundle exec rspec spec/integration
|
50
|
-
|
51
|
-
# dun devise dummy integration specs
|
52
|
-
$ bundle exec rspec spec/devise-integration
|
53
|
-
</pre>
|
54
|
-
|
55
|
-
We suggest you look at the wiki scenarios and check out the dummy apps to
|
56
|
-
get a feel for how to integrate CanTango in your app.
|
57
|
-
|
58
|
-
h2. Design overview
|
59
|
-
|
60
|
-
The CanTango pattern is simple:
|
61
|
-
1. Return cached rules (if available)
|
62
|
-
2. Generate rules
|
63
|
-
3. Cache rules
|
64
|
-
|
65
|
-
_CanTango::Ability#initialize_
|
66
|
-
|
67
|
-
1. Use cached rules and return if user has cached rules
|
68
|
-
2. Generate rules for Permits (if 'Permits engine' is turned on)
|
69
|
-
3. Generate rules for Permissions (if 'Permissions engine' is turned on)
|
70
|
-
4. Cache generated rules with unique key for current user (ability candidate)
|
71
|
-
|
72
|
-
See "CanTango Ability":https://github.com/kristianmandrup/cantango/wiki/Cantango-ability
|
38
|
+
h2. Update Sept 1, 2011
|
73
39
|
|
74
|
-
|
40
|
+
Version *0.8.5* has been released.
|
75
41
|
|
76
|
-
|
42
|
+
CanTango now supports "sugar-high 0.6":https://github.com/kristianmandrup/sugar-high.git' where "sweetloader":https://github.com/kristianmandrup/sweet_loader.git' has been extracted into its own gem.
|
77
43
|
|
78
|
-
|
44
|
+
* The Cache has been refactored
|
45
|
+
* Engines are now run in correct order (and only if active)
|
46
|
+
* The Cache Kompiler (for dynamic rules caching) and Moneta cache are now optional (via adapters)
|
47
|
+
* Permits are found and loaded via pre-registratio via the @#inherited@ method for the base permits. You can also use the _tango_permit_ macro.
|
48
|
+
* Better visibility of the @Ability@ flow, to allow one to see which rules are triggered by which permits (likely via a special :debug config mode, since it would affect performance).
|
79
49
|
|
80
|
-
|
50
|
+
The wiki will soon be updated to reflect these improvements and changes.
|
81
51
|
|
82
|
-
|
83
|
-
|
84
|
-
Currently the role system "Troles":https://github.com/kristianmandrup/troles is targeted, but any role system will do with a few minor patches on top
|
85
|
-
|
86
|
-
h2. Permission configuration
|
52
|
+
h2. Quickstart
|
87
53
|
|
88
|
-
|
89
|
-
* Permission store
|
90
|
-
* Permit classes
|
54
|
+
See the "Quickstart guide":https://github.com/kristianmandrup/cantango/wiki/Quickstart in the wiki.
|
91
55
|
|
92
|
-
|
56
|
+
For devise integration, see "Quickstart with Devise":https://github.com/kristianmandrup/cantango/wiki/Quickstart-cantango-with-devise
|
93
57
|
|
94
|
-
|
58
|
+
The following scenarios demonstrate some of the problems CanTango can help solve in an elegant way
|
95
59
|
|
96
|
-
|
60
|
+
* "Simple scenario":https://github.com/kristianmandrup/cantango/wiki/Simple-scenario
|
61
|
+
* "Complex scenario":https://github.com/kristianmandrup/cantango/wiki/Complex-scenario
|
97
62
|
|
98
|
-
|
99
|
-
A Permissions store can be either a simple YAML file or a key-value store supported by "Moneta":https://github.com/dkastner/moneta
|
63
|
+
h3. Generators
|
100
64
|
|
65
|
+
Cantango comes with a set of "Generators":https://github.com/kristianmandrup/cantango/wiki/Generators to get your app dancing...
|
66
|
+
Simply start with:
|
101
67
|
|
102
|
-
|
68
|
+
* cantango:install
|
103
69
|
|
104
|
-
|
105
|
-
* Define which roles are available
|
106
|
-
* Define a Permit for each role.
|
107
|
-
* For each Permit, define what Users with a role matching the permit can do
|
70
|
+
To use the Permit generators please see the Generators wiki page ;)
|
108
71
|
|
109
|
-
|
72
|
+
h3. Rails 3 configuration
|
110
73
|
|
111
|
-
CanTango
|
74
|
+
The CanTango "Configuration":https://github.com/kristianmandrup/cantango/wiki/Configuration consists of a nice DSL that let's you configure most of the things we imagine you would want to customize. Feel free to suggest more configuration options!
|
112
75
|
|
113
|
-
|
114
|
-
"Dancing":https://github.com/kristianmandrup/dancing will likely include a generator that you can use to
|
115
|
-
configure your Rails app for Devise, CanCan, CanTango and Troles.
|
76
|
+
h3. Access Control via Permits and Permissions
|
116
77
|
|
117
|
-
|
78
|
+
AC rules can be defined in both:
|
118
79
|
|
119
|
-
|
80
|
+
* "Permissions":https://github.com/kristianmandrup/cantango/wiki/Permissions (fx a yaml file)
|
81
|
+
* "Permits":https://github.com/kristianmandrup/cantango/wiki/Permits (special classes)
|
120
82
|
|
121
|
-
|
122
|
-
|
123
|
-
* "Simple scenario":https://github.com/kristianmandrup/cantango/wiki/Simple-scenario
|
124
|
-
* "Complex scenario":https://github.com/kristianmandrup/cantango/wiki/Complex-scenario
|
125
|
-
|
126
|
-
h2. Define Permits
|
127
|
-
|
128
|
-
Permits can be defined for any of the following:
|
83
|
+
AC rules can be defined for the following conceptual entities:
|
129
84
|
|
85
|
+
* User models
|
86
|
+
* User Account models
|
130
87
|
* Roles
|
131
88
|
* Role groups
|
132
|
-
*
|
133
|
-
|
134
|
-
In addition you can also define _licenses_, that are sets of permit rules that can be reused in various role and role group permits.
|
135
|
-
|
136
|
-
You can use Generators to generate your permits. All Permit classes should be placed in the app/permits folder of a Rails app.
|
137
|
-
|
138
|
-
See "Role permits":https://github.com/kristianmandrup/cantango/wiki/Role-Permits in the wiki.
|
139
|
-
|
140
|
-
h3. Account permits
|
89
|
+
* Users
|
141
90
|
|
142
|
-
|
91
|
+
h3. Design overview
|
143
92
|
|
144
|
-
|
93
|
+
The default CanTango ability pattern is simple.
|
145
94
|
|
146
|
-
|
95
|
+
1. Return cached rules for ability candidate if available
|
96
|
+
2. Generate rules for candidate
|
97
|
+
3. Cache rules for candidate
|
147
98
|
|
148
|
-
|
99
|
+
An ability candidate is typically either a user or an account instance.
|
149
100
|
|
150
|
-
|
101
|
+
Caching can be enabled or disabled. To generate the rules, one or more engines are executed.
|
151
102
|
|
152
|
-
|
153
|
-
advanced permission scenarios as described in the wiki. You also have
|
154
|
-
other special options available for advanced permission scenarios.
|
103
|
+
CanTango comes with the following engines:
|
155
104
|
|
156
|
-
|
105
|
+
* "Permit engine"::https://github.com/kristianmandrup/cantango/wiki/Permit-engine
|
106
|
+
* "Permission engine":https://github.com/kristianmandrup/cantango/wiki/Permission-engine
|
157
107
|
|
158
|
-
|
108
|
+
You can however freely plugin or unplug engines as you wish as described in "Pluggable engines":https://github.com/kristianmandrup/cantango/wiki/Pluggable-engines
|
159
109
|
|
160
|
-
|
110
|
+
h3. Dependencies, Adapters and Loading
|
161
111
|
|
162
|
-
|
112
|
+
CanTango had been designed to be minimally intrusive and not require too many external dependencies.
|
163
113
|
|
164
|
-
|
114
|
+
If you want to enable Moneta for caching or storage, you must execute an adapter macro: @CanTango.adapter :moneta@
|
165
115
|
|
166
|
-
|
116
|
+
This will setup lazy-loading of Moneta cache and Moneta store respectively.
|
117
|
+
If you want to enable compilation of dynamic rules (using blocks) you must use the @:compiler@ adapter
|
167
118
|
|
168
|
-
|
169
|
-
* can_tango:role_permits - generate multiple permits
|
170
|
-
* can_tango:role_permit - generate a single permit
|
171
|
-
* can_tango:licenses - generate multiple licenses
|
172
|
-
* can_tango:license - generate a single license
|
119
|
+
If you use any of these adapters, you must manually include the following in your Rails app Gemfile.
|
173
120
|
|
174
|
-
|
121
|
+
@gem 'dkastner-moneta'@ for moneta adapter and @gem 'sourcify'@ for the compiler adapter.
|
175
122
|
|
176
|
-
|
123
|
+
CanTango uses @autoload_modules@ from the "sweetloader":https://github.com/kristianmandrup/sweet_loader.git' gem.
|
124
|
+
This ensures that all such modules are lazy-loaded. Thus if you configure CanTango to exclude an engine, the code for that engine will never be loaded, minimizing the load time and memory print.
|
177
125
|
|
178
126
|
h2. You need help?
|
179
127
|
|
@@ -193,19 +141,19 @@ If you encounter bugs, raise an issue or:
|
|
193
141
|
|
194
142
|
h2. Contributors
|
195
143
|
|
196
|
-
*
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
144
|
+
*Kristian Mandrup*
|
145
|
+
- Main architect
|
146
|
+
- Designer of structure
|
147
|
+
- Feature ideas
|
148
|
+
- Initiator of project
|
149
|
+
- Devise app integration specs
|
202
150
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
151
|
+
"Stanislaw Pankevich":https://github.com/stanislaw
|
152
|
+
- Main contributor of permissions engine
|
153
|
+
- Caching of Procs for caching engine
|
154
|
+
- Lots of bug fixes and specs
|
155
|
+
- Tireless "worker" ;)
|
208
156
|
|
209
|
-
|
157
|
+
h3. Copyright
|
210
158
|
|
211
159
|
Copyright (c) 2010 Kristian Mandrup. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.5.1
|
data/cantango.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cantango}
|
8
|
-
s.version = "0.8.
|
8
|
+
s.version = "0.8.5.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Kristian Mandrup}, %q{Stanislaw Pankevich}]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-09-02}
|
13
13
|
s.description = %q{Define your permission rules as role- or role group specific permits.
|
14
14
|
Integrates well with multiple Devise user acounts.
|
15
15
|
Includes rules caching.
|
@@ -33,24 +33,25 @@ Store permissions in yaml file or key-value store}
|
|
33
33
|
"lib/cantango/ability.rb",
|
34
34
|
"lib/cantango/ability/cache.rb",
|
35
35
|
"lib/cantango/ability/cache/base_cache.rb",
|
36
|
+
"lib/cantango/ability/cache/key.rb",
|
36
37
|
"lib/cantango/ability/cache/kompiler.rb",
|
37
38
|
"lib/cantango/ability/cache/moneta_cache.rb",
|
39
|
+
"lib/cantango/ability/cache/reader.rb",
|
40
|
+
"lib/cantango/ability/cache/rules_cache.rb",
|
38
41
|
"lib/cantango/ability/cache/session_cache.rb",
|
39
|
-
"lib/cantango/ability/
|
42
|
+
"lib/cantango/ability/cache/writer.rb",
|
43
|
+
"lib/cantango/ability/cache_helpers.rb",
|
40
44
|
"lib/cantango/ability/masquerade_helpers.rb",
|
41
45
|
"lib/cantango/ability/permission_helpers.rb",
|
42
46
|
"lib/cantango/ability/permit_helpers.rb",
|
43
47
|
"lib/cantango/ability/role_helpers.rb",
|
44
48
|
"lib/cantango/ability/scope.rb",
|
45
49
|
"lib/cantango/ability/user_helpers.rb",
|
50
|
+
"lib/cantango/adapter/compiler.rb",
|
51
|
+
"lib/cantango/adapter/moneta.rb",
|
46
52
|
"lib/cantango/api.rb",
|
47
53
|
"lib/cantango/api/aliases.rb",
|
48
|
-
"lib/cantango/api/
|
49
|
-
"lib/cantango/api/aliases/license.rb",
|
50
|
-
"lib/cantango/api/aliases/permit.rb",
|
51
|
-
"lib/cantango/api/aliases/role_group_permit.rb",
|
52
|
-
"lib/cantango/api/aliases/role_permit.rb",
|
53
|
-
"lib/cantango/api/aliases/user_permit.rb",
|
54
|
+
"lib/cantango/api/attributes.rb",
|
54
55
|
"lib/cantango/api/common.rb",
|
55
56
|
"lib/cantango/api/options.rb",
|
56
57
|
"lib/cantango/api/user.rb",
|
@@ -62,10 +63,12 @@ Store permissions in yaml file or key-value store}
|
|
62
63
|
"lib/cantango/api/user_account/can.rb",
|
63
64
|
"lib/cantango/api/user_account/scope.rb",
|
64
65
|
"lib/cantango/cache.rb",
|
66
|
+
"lib/cantango/cache/hash_cache.rb",
|
65
67
|
"lib/cantango/cache/moneta_cache.rb",
|
66
68
|
"lib/cantango/cancan/rule.rb",
|
67
69
|
"lib/cantango/configuration.rb",
|
68
70
|
"lib/cantango/configuration/ability.rb",
|
71
|
+
"lib/cantango/configuration/adapters.rb",
|
69
72
|
"lib/cantango/configuration/autoload.rb",
|
70
73
|
"lib/cantango/configuration/categories.rb",
|
71
74
|
"lib/cantango/configuration/engines.rb",
|
@@ -78,6 +81,8 @@ Store permissions in yaml file or key-value store}
|
|
78
81
|
"lib/cantango/configuration/guest.rb",
|
79
82
|
"lib/cantango/configuration/hash_registry.rb",
|
80
83
|
"lib/cantango/configuration/models.rb",
|
84
|
+
"lib/cantango/configuration/permit_registry.rb",
|
85
|
+
"lib/cantango/configuration/permits.rb",
|
81
86
|
"lib/cantango/configuration/registry.rb",
|
82
87
|
"lib/cantango/configuration/role_groups.rb",
|
83
88
|
"lib/cantango/configuration/role_registry.rb",
|
@@ -86,10 +91,14 @@ Store permissions in yaml file or key-value store}
|
|
86
91
|
"lib/cantango/configuration/user_account.rb",
|
87
92
|
"lib/cantango/configuration/user_accounts.rb",
|
88
93
|
"lib/cantango/configuration/users.rb",
|
94
|
+
"lib/cantango/engine.rb",
|
95
|
+
"lib/cantango/filters.rb",
|
96
|
+
"lib/cantango/filters/filter.rb",
|
97
|
+
"lib/cantango/filters/role_filter.rb",
|
98
|
+
"lib/cantango/filters/role_group_filter.rb",
|
89
99
|
"lib/cantango/helpers.rb",
|
90
100
|
"lib/cantango/helpers/role_methods.rb",
|
91
101
|
"lib/cantango/permission_engine.rb",
|
92
|
-
"lib/cantango/permission_engine/builder.rb",
|
93
102
|
"lib/cantango/permission_engine/collector.rb",
|
94
103
|
"lib/cantango/permission_engine/compiler.rb",
|
95
104
|
"lib/cantango/permission_engine/evaluator.rb",
|
@@ -110,19 +119,18 @@ Store permissions in yaml file or key-value store}
|
|
110
119
|
"lib/cantango/permission_engine/parser/rule.rb",
|
111
120
|
"lib/cantango/permission_engine/permission.rb",
|
112
121
|
"lib/cantango/permission_engine/selector.rb",
|
122
|
+
"lib/cantango/permission_engine/selector/account_types.rb",
|
113
123
|
"lib/cantango/permission_engine/selector/base.rb",
|
114
124
|
"lib/cantango/permission_engine/selector/licenses.rb",
|
115
125
|
"lib/cantango/permission_engine/selector/role_groups.rb",
|
116
126
|
"lib/cantango/permission_engine/selector/roles.rb",
|
127
|
+
"lib/cantango/permission_engine/selector/user_types.rb",
|
117
128
|
"lib/cantango/permission_engine/selector/users.rb",
|
118
129
|
"lib/cantango/permission_engine/statement.rb",
|
119
130
|
"lib/cantango/permission_engine/statements.rb",
|
120
131
|
"lib/cantango/permission_engine/store.rb",
|
121
132
|
"lib/cantango/permission_engine/yaml_store.rb",
|
122
133
|
"lib/cantango/permit_engine.rb",
|
123
|
-
"lib/cantango/permit_engine/account_permit.rb",
|
124
|
-
"lib/cantango/permit_engine/account_permit/builder.rb",
|
125
|
-
"lib/cantango/permit_engine/account_permit/finder.rb",
|
126
134
|
"lib/cantango/permit_engine/builder.rb",
|
127
135
|
"lib/cantango/permit_engine/builder/base.rb",
|
128
136
|
"lib/cantango/permit_engine/builder/special_permits.rb",
|
@@ -133,27 +141,33 @@ Store permissions in yaml file or key-value store}
|
|
133
141
|
"lib/cantango/permit_engine/executor/system.rb",
|
134
142
|
"lib/cantango/permit_engine/factory.rb",
|
135
143
|
"lib/cantango/permit_engine/finder.rb",
|
136
|
-
"lib/cantango/permit_engine/license.rb",
|
137
|
-
"lib/cantango/permit_engine/license/loader.rb",
|
138
|
-
"lib/cantango/permit_engine/license/rules.rb",
|
139
|
-
"lib/cantango/permit_engine/permit.rb",
|
140
|
-
"lib/cantango/permit_engine/role_group_permit.rb",
|
141
|
-
"lib/cantango/permit_engine/role_group_permit/builder.rb",
|
142
|
-
"lib/cantango/permit_engine/role_group_permit/finder.rb",
|
143
144
|
"lib/cantango/permit_engine/role_matcher.rb",
|
144
|
-
"lib/cantango/permit_engine/role_permit.rb",
|
145
|
-
"lib/cantango/permit_engine/role_permit/builder.rb",
|
146
|
-
"lib/cantango/permit_engine/role_permit/finder.rb",
|
147
|
-
"lib/cantango/permit_engine/user_permit.rb",
|
148
|
-
"lib/cantango/permit_engine/user_permit/builder.rb",
|
149
|
-
"lib/cantango/permit_engine/user_permit/finder.rb",
|
150
145
|
"lib/cantango/permit_engine/util.rb",
|
146
|
+
"lib/cantango/permits.rb",
|
147
|
+
"lib/cantango/permits/account_permit.rb",
|
148
|
+
"lib/cantango/permits/account_permit/builder.rb",
|
149
|
+
"lib/cantango/permits/account_permit/finder.rb",
|
150
|
+
"lib/cantango/permits/license.rb",
|
151
|
+
"lib/cantango/permits/license/loader.rb",
|
152
|
+
"lib/cantango/permits/license/rules.rb",
|
153
|
+
"lib/cantango/permits/macros.rb",
|
154
|
+
"lib/cantango/permits/permit.rb",
|
155
|
+
"lib/cantango/permits/role_group_permit.rb",
|
156
|
+
"lib/cantango/permits/role_group_permit/builder.rb",
|
157
|
+
"lib/cantango/permits/role_group_permit/finder.rb",
|
158
|
+
"lib/cantango/permits/role_permit.rb",
|
159
|
+
"lib/cantango/permits/role_permit/builder.rb",
|
160
|
+
"lib/cantango/permits/role_permit/finder.rb",
|
161
|
+
"lib/cantango/permits/user_permit.rb",
|
162
|
+
"lib/cantango/permits/user_permit/builder.rb",
|
163
|
+
"lib/cantango/permits/user_permit/finder.rb",
|
151
164
|
"lib/cantango/rails.rb",
|
152
|
-
"lib/cantango/rails/base_helpers.rb",
|
153
|
-
"lib/cantango/rails/controller_helpers.rb",
|
154
165
|
"lib/cantango/rails/engine.rb",
|
166
|
+
"lib/cantango/rails/helpers/base_helper.rb",
|
167
|
+
"lib/cantango/rails/helpers/controller_helper.rb",
|
168
|
+
"lib/cantango/rails/helpers/rest_helper.rb",
|
169
|
+
"lib/cantango/rails/helpers/view_helper.rb",
|
155
170
|
"lib/cantango/rails/railtie.rb",
|
156
|
-
"lib/cantango/rails/view_helpers.rb",
|
157
171
|
"lib/cantango/rspec.rb",
|
158
172
|
"lib/cantango/rspec/config.rb",
|
159
173
|
"lib/cantango/rspec/matchers.rb",
|
@@ -176,7 +190,14 @@ Store permissions in yaml file or key-value store}
|
|
176
190
|
"lib/cantango/users/masquerade/session_active_user.rb",
|
177
191
|
"lib/cantango/users/user.rb",
|
178
192
|
"lib/cantango/users/user_account.rb",
|
193
|
+
"lib/generators/cantango/account_permit/account_permit_generator.rb",
|
194
|
+
"lib/generators/cantango/account_permit/templates/account_permit.erb",
|
179
195
|
"lib/generators/cantango/base.rb",
|
196
|
+
"lib/generators/cantango/basic.rb",
|
197
|
+
"lib/generators/cantango/install/install_generator.rb",
|
198
|
+
"lib/generators/cantango/install/templates/cantango.rb",
|
199
|
+
"lib/generators/cantango/install/templates/categories.yml",
|
200
|
+
"lib/generators/cantango/install/templates/permissions.yml",
|
180
201
|
"lib/generators/cantango/license/license_generator.rb",
|
181
202
|
"lib/generators/cantango/license/templates/license.erb",
|
182
203
|
"lib/generators/cantango/license_base.rb",
|
@@ -187,6 +208,9 @@ Store permissions in yaml file or key-value store}
|
|
187
208
|
"lib/generators/cantango/role_permit/templates/role_group_permit.erb",
|
188
209
|
"lib/generators/cantango/role_permit/templates/role_permit.erb",
|
189
210
|
"lib/generators/cantango/role_permits/role_permits_generator.rb",
|
211
|
+
"lib/generators/cantango/user_permit/templates/account_permit.erb",
|
212
|
+
"lib/generators/cantango/user_permit/templates/user_permit.erb",
|
213
|
+
"lib/generators/cantango/user_permit/user_permit_generator.rb",
|
190
214
|
"spec/Note_on_licenses.textile",
|
191
215
|
"spec/Refactor_into_engines.textile",
|
192
216
|
"spec/TODO",
|
@@ -205,8 +229,8 @@ Store permissions in yaml file or key-value store}
|
|
205
229
|
"spec/active_record/migrations/006_create_todo.rb",
|
206
230
|
"spec/active_record/migrations/007_create_user_todos.rb",
|
207
231
|
"spec/active_record/scenarios/SCENARIOS README.textile",
|
208
|
-
"spec/active_record/scenarios/engines/permission_engine/cantango_permissions.yml",
|
209
232
|
"spec/active_record/scenarios/engines/permission_engine/categories.yml",
|
233
|
+
"spec/active_record/scenarios/engines/permission_engine/permissions.yml",
|
210
234
|
"spec/active_record/scenarios/engines/permission_engine/tango_permission_yml_spec.rb",
|
211
235
|
"spec/active_record/scenarios/engines/permission_engine/users.rb",
|
212
236
|
"spec/active_record/scenarios/engines/permit_engine/licenses_spec.rb",
|
@@ -220,7 +244,7 @@ Store permissions in yaml file or key-value store}
|
|
220
244
|
"spec/active_record/scenarios/masquerading/masquerading_for_admin_account_spec.rb",
|
221
245
|
"spec/active_record/scenarios/masquerading/masquerading_for_admin_user_spec.rb",
|
222
246
|
"spec/active_record/scenarios/shared/api.rb",
|
223
|
-
"spec/active_record/scenarios/shared/
|
247
|
+
"spec/active_record/scenarios/shared/cantango.rb",
|
224
248
|
"spec/active_record/scenarios/shared/examples/user_accounts.rb",
|
225
249
|
"spec/active_record/scenarios/shared/examples/users.rb",
|
226
250
|
"spec/active_record/scenarios/shared/licenses/musicians_license.rb",
|
@@ -228,7 +252,6 @@ Store permissions in yaml file or key-value store}
|
|
228
252
|
"spec/active_record/scenarios/shared/models/todo.rb",
|
229
253
|
"spec/active_record/scenarios/shared/models/user_todo.rb",
|
230
254
|
"spec/active_record/scenarios/shared/models/users.rb",
|
231
|
-
"spec/active_record/scenarios/shared/permits/PERMITS README.textile",
|
232
255
|
"spec/active_record/scenarios/shared/permits/account_permits/admin_account_permit.rb",
|
233
256
|
"spec/active_record/scenarios/shared/permits/account_permits/guest_account_permit.rb",
|
234
257
|
"spec/active_record/scenarios/shared/permits/account_permits/user_account_permit.rb",
|
@@ -242,9 +265,6 @@ Store permissions in yaml file or key-value store}
|
|
242
265
|
"spec/active_record/scenarios/shared/permits/special/any_role_permit.rb",
|
243
266
|
"spec/active_record/scenarios/shared/permits/special/system_role_permit.rb",
|
244
267
|
"spec/active_record/scenarios/user_accounts/admin_account_spec.rb",
|
245
|
-
"spec/active_record/scenarios/user_accounts/config/account_permits.yml",
|
246
|
-
"spec/active_record/scenarios/user_accounts/docs/USER_ACCOUNTS_SCENARIO.textile",
|
247
|
-
"spec/active_record/scenarios/user_accounts/docs/basic_rules_spec_possible_samples.txt",
|
248
268
|
"spec/active_record/scenarios/user_accounts/guest_account_spec.rb",
|
249
269
|
"spec/active_record/scenarios/user_accounts/helpers.rb",
|
250
270
|
"spec/active_record/scenarios/user_accounts/helpers/account_setup.rb",
|
@@ -255,11 +275,17 @@ Store permissions in yaml file or key-value store}
|
|
255
275
|
"spec/active_record/scenarios/user_accounts/user_account_spec.rb",
|
256
276
|
"spec/active_record/spec_helper.rb",
|
257
277
|
"spec/cantango/README.textile",
|
258
|
-
"spec/cantango/ability/cache/
|
278
|
+
"spec/cantango/ability/cache/key_spec.rb",
|
279
|
+
"spec/cantango/ability/cache/kompiler_spec.rb",
|
280
|
+
"spec/cantango/ability/cache/reader_compile_spec.rb",
|
281
|
+
"spec/cantango/ability/cache/reader_spec.rb",
|
282
|
+
"spec/cantango/ability/cache/rules_cache_spec.rb",
|
259
283
|
"spec/cantango/ability/cache/session_cache_spec.rb",
|
284
|
+
"spec/cantango/ability/cache/writer_spec.rb",
|
260
285
|
"spec/cantango/ability/cache_spec.rb",
|
261
286
|
"spec/cantango/ability_filters_spec.rb",
|
262
287
|
"spec/cantango/ability_spec.rb",
|
288
|
+
"spec/cantango/api/attributes_spec.rb",
|
263
289
|
"spec/cantango/api/current_user_accounts.rb",
|
264
290
|
"spec/cantango/api/current_users.rb",
|
265
291
|
"spec/cantango/api/user/ability_api_spec.rb",
|
@@ -271,6 +297,7 @@ Store permissions in yaml file or key-value store}
|
|
271
297
|
"spec/cantango/api/user_account_api_spec.rb",
|
272
298
|
"spec/cantango/api/user_api_spec.rb",
|
273
299
|
"spec/cantango/configuration/ability_spec.rb",
|
300
|
+
"spec/cantango/configuration/adapter_spec.rb",
|
274
301
|
"spec/cantango/configuration/autoload_spec.rb",
|
275
302
|
"spec/cantango/configuration/categories_spec.rb",
|
276
303
|
"spec/cantango/configuration/engines/cache_spec.rb",
|
@@ -284,6 +311,8 @@ Store permissions in yaml file or key-value store}
|
|
284
311
|
"spec/cantango/configuration/guest/find_guest_default_way_spec.rb",
|
285
312
|
"spec/cantango/configuration/guest_spec.rb",
|
286
313
|
"spec/cantango/configuration/hash_registry_spec.rb",
|
314
|
+
"spec/cantango/configuration/permit_registry_spec.rb",
|
315
|
+
"spec/cantango/configuration/permits_spec.rb",
|
287
316
|
"spec/cantango/configuration/registry_spec.rb",
|
288
317
|
"spec/cantango/configuration/role_groups_spec.rb",
|
289
318
|
"spec/cantango/configuration/roles_spec.rb",
|
@@ -314,6 +343,7 @@ Store permissions in yaml file or key-value store}
|
|
314
343
|
"spec/cantango/permission_engine/store_spec.rb",
|
315
344
|
"spec/cantango/permission_engine/user_permission_store_spec.rb",
|
316
345
|
"spec/cantango/permission_engine/yaml_store_spec.rb",
|
346
|
+
"spec/cantango/permission_engine_spec.rb",
|
317
347
|
"spec/cantango/permit_engine/account_permit_spec.rb",
|
318
348
|
"spec/cantango/permit_engine/builder/role_group_permits_spec.rb",
|
319
349
|
"spec/cantango/permit_engine/builder/role_permits_spec.rb",
|
@@ -325,7 +355,11 @@ Store permissions in yaml file or key-value store}
|
|
325
355
|
"spec/cantango/permit_engine/role_group_permit_spec.rb",
|
326
356
|
"spec/cantango/permit_engine/role_permit_spec.rb",
|
327
357
|
"spec/cantango/permit_engine/user_permit_spec.rb",
|
358
|
+
"spec/cantango/permit_engine_spec.rb",
|
359
|
+
"spec/cantango/permits/macros_spec.rb",
|
360
|
+
"spec/cantango/permits/permit_spec.rb",
|
328
361
|
"spec/cantango/rules_spec.rb",
|
362
|
+
"spec/cantango_spec.rb",
|
329
363
|
"spec/devise-dummy/Rakefile",
|
330
364
|
"spec/devise-dummy/app/controllers/accounts_controller.rb",
|
331
365
|
"spec/devise-dummy/app/controllers/application_controller.rb",
|
@@ -392,7 +426,6 @@ Store permissions in yaml file or key-value store}
|
|
392
426
|
"spec/devise-dummy/config.ru",
|
393
427
|
"spec/devise-dummy/config/application.rb",
|
394
428
|
"spec/devise-dummy/config/boot.rb",
|
395
|
-
"spec/devise-dummy/config/cantango_permissions.yml",
|
396
429
|
"spec/devise-dummy/config/categories.yml",
|
397
430
|
"spec/devise-dummy/config/database.yml",
|
398
431
|
"spec/devise-dummy/config/environment.rb",
|
@@ -409,6 +442,7 @@ Store permissions in yaml file or key-value store}
|
|
409
442
|
"spec/devise-dummy/config/initializers/simple_roles.rb",
|
410
443
|
"spec/devise-dummy/config/locales/devise.en.yml",
|
411
444
|
"spec/devise-dummy/config/locales/en.yml",
|
445
|
+
"spec/devise-dummy/config/permissions.yml",
|
412
446
|
"spec/devise-dummy/config/routes.rb",
|
413
447
|
"spec/devise-dummy/db/migrate/002_create_comment.rb",
|
414
448
|
"spec/devise-dummy/db/migrate/003_create_post.rb",
|
@@ -489,7 +523,6 @@ Store permissions in yaml file or key-value store}
|
|
489
523
|
"spec/dummy/config.ru",
|
490
524
|
"spec/dummy/config/application.rb",
|
491
525
|
"spec/dummy/config/boot.rb",
|
492
|
-
"spec/dummy/config/cantango_permissions.yml",
|
493
526
|
"spec/dummy/config/categories.yml",
|
494
527
|
"spec/dummy/config/database.yml",
|
495
528
|
"spec/dummy/config/environment.rb",
|
@@ -504,6 +537,7 @@ Store permissions in yaml file or key-value store}
|
|
504
537
|
"spec/dummy/config/initializers/session_store.rb",
|
505
538
|
"spec/dummy/config/initializers/simple_roles.rb",
|
506
539
|
"spec/dummy/config/locales/en.yml",
|
540
|
+
"spec/dummy/config/permissions.yml",
|
507
541
|
"spec/dummy/config/routes.rb",
|
508
542
|
"spec/dummy/db/migrate/001_create_user.rb",
|
509
543
|
"spec/dummy/db/migrate/002_create_comment.rb",
|
@@ -526,8 +560,8 @@ Store permissions in yaml file or key-value store}
|
|
526
560
|
"spec/dummy/tmp/pids/server.pid",
|
527
561
|
"spec/dummy_spec_helper.rb",
|
528
562
|
"spec/entire_suite_spec.rb",
|
529
|
-
"spec/factories.rb",
|
530
|
-
"spec/
|
563
|
+
"spec/factories/user.rb",
|
564
|
+
"spec/factories/user_account.rb",
|
531
565
|
"spec/fixtures/config/categories.yml",
|
532
566
|
"spec/fixtures/config/evaluator_fixtures.yml",
|
533
567
|
"spec/fixtures/config/licenses.yml",
|
@@ -536,6 +570,8 @@ Store permissions in yaml file or key-value store}
|
|
536
570
|
"spec/fixtures/config/roles.yml",
|
537
571
|
"spec/fixtures/config/user_permissions.yml",
|
538
572
|
"spec/fixtures/models.rb",
|
573
|
+
"spec/fixtures/models/admin.rb",
|
574
|
+
"spec/fixtures/models/admin_account.rb",
|
539
575
|
"spec/fixtures/models/items.rb",
|
540
576
|
"spec/fixtures/models/simple_roles.rb",
|
541
577
|
"spec/fixtures/models/user.rb",
|
@@ -601,7 +637,7 @@ Store permissions in yaml file or key-value store}
|
|
601
637
|
s.homepage = %q{http://github.com/kristianmandrup/cantango}
|
602
638
|
s.licenses = [%q{MIT}]
|
603
639
|
s.require_paths = [%q{lib}]
|
604
|
-
s.rubygems_version = %q{1.8.
|
640
|
+
s.rubygems_version = %q{1.8.8}
|
605
641
|
s.summary = %q{CanCan extension with role oriented permission management and more}
|
606
642
|
|
607
643
|
if s.respond_to? :specification_version then
|
@@ -610,48 +646,45 @@ Store permissions in yaml file or key-value store}
|
|
610
646
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
611
647
|
s.add_runtime_dependency(%q<rails>, [">= 3.0.1"])
|
612
648
|
s.add_runtime_dependency(%q<cancan>, [">= 1.4"])
|
613
|
-
s.add_runtime_dependency(%q<sugar-high>, [">= 0.
|
649
|
+
s.add_runtime_dependency(%q<sugar-high>, [">= 0.6.0"])
|
650
|
+
s.add_runtime_dependency(%q<sweetloader>, ["~> 0.1.0"])
|
614
651
|
s.add_runtime_dependency(%q<sqlite3>, [">= 0"])
|
615
652
|
s.add_runtime_dependency(%q<hashie>, [">= 0.4"])
|
616
|
-
s.
|
617
|
-
s.
|
618
|
-
s.
|
619
|
-
s.
|
620
|
-
s.add_development_dependency(%q<devise>, [">= 0"])
|
621
|
-
s.add_development_dependency(%q<rspec>, [">= 2.5.0"])
|
653
|
+
s.add_development_dependency(%q<factory_girl>, [">= 0"])
|
654
|
+
s.add_development_dependency(%q<sourcify>, [">= 0"])
|
655
|
+
s.add_development_dependency(%q<dkastner-moneta>, [">= 1.0"])
|
656
|
+
s.add_development_dependency(%q<rspec>, [">= 2.4.0"])
|
622
657
|
s.add_development_dependency(%q<jeweler>, [">= 1.6.4"])
|
623
|
-
s.add_development_dependency(%q<bundler>, ["
|
658
|
+
s.add_development_dependency(%q<bundler>, [">= 1.0.1"])
|
624
659
|
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
625
660
|
else
|
626
661
|
s.add_dependency(%q<rails>, [">= 3.0.1"])
|
627
662
|
s.add_dependency(%q<cancan>, [">= 1.4"])
|
628
|
-
s.add_dependency(%q<sugar-high>, [">= 0.
|
663
|
+
s.add_dependency(%q<sugar-high>, [">= 0.6.0"])
|
664
|
+
s.add_dependency(%q<sweetloader>, ["~> 0.1.0"])
|
629
665
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
630
666
|
s.add_dependency(%q<hashie>, [">= 0.4"])
|
667
|
+
s.add_dependency(%q<factory_girl>, [">= 0"])
|
631
668
|
s.add_dependency(%q<sourcify>, [">= 0"])
|
632
669
|
s.add_dependency(%q<dkastner-moneta>, [">= 1.0"])
|
633
|
-
s.add_dependency(%q<
|
634
|
-
s.add_dependency(%q<meta_where>, [">= 0"])
|
635
|
-
s.add_dependency(%q<devise>, [">= 0"])
|
636
|
-
s.add_dependency(%q<rspec>, [">= 2.5.0"])
|
670
|
+
s.add_dependency(%q<rspec>, [">= 2.4.0"])
|
637
671
|
s.add_dependency(%q<jeweler>, [">= 1.6.4"])
|
638
|
-
s.add_dependency(%q<bundler>, ["
|
672
|
+
s.add_dependency(%q<bundler>, [">= 1.0.1"])
|
639
673
|
s.add_dependency(%q<rdoc>, [">= 0"])
|
640
674
|
end
|
641
675
|
else
|
642
676
|
s.add_dependency(%q<rails>, [">= 3.0.1"])
|
643
677
|
s.add_dependency(%q<cancan>, [">= 1.4"])
|
644
|
-
s.add_dependency(%q<sugar-high>, [">= 0.
|
678
|
+
s.add_dependency(%q<sugar-high>, [">= 0.6.0"])
|
679
|
+
s.add_dependency(%q<sweetloader>, ["~> 0.1.0"])
|
645
680
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
646
681
|
s.add_dependency(%q<hashie>, [">= 0.4"])
|
682
|
+
s.add_dependency(%q<factory_girl>, [">= 0"])
|
647
683
|
s.add_dependency(%q<sourcify>, [">= 0"])
|
648
684
|
s.add_dependency(%q<dkastner-moneta>, [">= 1.0"])
|
649
|
-
s.add_dependency(%q<
|
650
|
-
s.add_dependency(%q<meta_where>, [">= 0"])
|
651
|
-
s.add_dependency(%q<devise>, [">= 0"])
|
652
|
-
s.add_dependency(%q<rspec>, [">= 2.5.0"])
|
685
|
+
s.add_dependency(%q<rspec>, [">= 2.4.0"])
|
653
686
|
s.add_dependency(%q<jeweler>, [">= 1.6.4"])
|
654
|
-
s.add_dependency(%q<bundler>, ["
|
687
|
+
s.add_dependency(%q<bundler>, [">= 1.0.1"])
|
655
688
|
s.add_dependency(%q<rdoc>, [">= 0"])
|
656
689
|
end
|
657
690
|
end
|