authorizy 0.4.1 → 0.6.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +25 -11
- data/lib/authorizy/config.rb +1 -1
- data/lib/authorizy/core.rb +6 -6
- data/lib/authorizy/expander.rb +7 -11
- data/lib/authorizy/extension.rb +9 -6
- data/lib/authorizy/rspec.rb +3 -3
- data/lib/authorizy/version.rb +1 -1
- metadata +8 -184
- data/spec/authorizy/base_cop/access_question_spec.rb +0 -10
- data/spec/authorizy/config/aliases_spec.rb +0 -13
- data/spec/authorizy/config/cop_spec.rb +0 -13
- data/spec/authorizy/config/current_user_spec.rb +0 -29
- data/spec/authorizy/config/denied_spec.rb +0 -51
- data/spec/authorizy/config/dependencies_spec.rb +0 -13
- data/spec/authorizy/config/field_spec.rb +0 -29
- data/spec/authorizy/config/initialize_spec.rb +0 -7
- data/spec/authorizy/config/redirect_url_spec.rb +0 -31
- data/spec/authorizy/cop/controller_spec.rb +0 -41
- data/spec/authorizy/cop/model_spec.rb +0 -16
- data/spec/authorizy/cop/namespaced_controller_spec.rb +0 -41
- data/spec/authorizy/core/access_spec.rb +0 -181
- data/spec/authorizy/expander/expand_spec.rb +0 -139
- data/spec/authorizy/extension/authorizy_question_spec.rb +0 -50
- data/spec/authorizy/extension/authorizy_spec.rb +0 -54
- data/spec/authorizy/rspec_spec.rb +0 -11
- data/spec/common_helper.rb +0 -13
- data/spec/spec_helper.rb +0 -29
- data/spec/support/application.rb +0 -8
- data/spec/support/common.rb +0 -13
- data/spec/support/controllers/admin/dummy_controller.rb +0 -13
- data/spec/support/controllers/dummy_controller.rb +0 -11
- data/spec/support/coverage.rb +0 -18
- data/spec/support/i18n.rb +0 -3
- data/spec/support/locales/en.yml +0 -3
- data/spec/support/models/authorizy_cop.rb +0 -31
- data/spec/support/models/empty_cop.rb +0 -4
- data/spec/support/models/user.rb +0 -4
- data/spec/support/routes.rb +0 -6
- data/spec/support/schema.rb +0 -22
data/spec/support/locales/en.yml
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class AuthorizyCop < Authorizy::BaseCop
|
4
|
-
def admin__dummy
|
5
|
-
params[:admin] == 'true'
|
6
|
-
end
|
7
|
-
|
8
|
-
def dummy
|
9
|
-
params[:access] == 'true'
|
10
|
-
end
|
11
|
-
|
12
|
-
def fetch_action
|
13
|
-
action
|
14
|
-
end
|
15
|
-
|
16
|
-
def fetch_controller
|
17
|
-
controller
|
18
|
-
end
|
19
|
-
|
20
|
-
def fetch_current_user
|
21
|
-
current_user
|
22
|
-
end
|
23
|
-
|
24
|
-
def fetch_params
|
25
|
-
params
|
26
|
-
end
|
27
|
-
|
28
|
-
def fetch_session
|
29
|
-
session
|
30
|
-
end
|
31
|
-
end
|
data/spec/support/models/user.rb
DELETED
data/spec/support/routes.rb
DELETED
data/spec/support/schema.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_record'
|
4
|
-
require 'support/models/user'
|
5
|
-
|
6
|
-
ActiveRecord::Base.establish_connection(
|
7
|
-
adapter: 'postgresql',
|
8
|
-
host: 'localhost',
|
9
|
-
username: 'postgres'
|
10
|
-
)
|
11
|
-
|
12
|
-
ActiveRecord::Base.connection.execute('DROP DATABASE IF EXISTS authorizy_test;')
|
13
|
-
ActiveRecord::Base.connection.execute('CREATE DATABASE authorizy_test;')
|
14
|
-
ActiveRecord::Base.connection.execute('DROP TABLE IF EXISTS users;')
|
15
|
-
|
16
|
-
ActiveRecord::Schema.define(version: 1) do
|
17
|
-
enable_extension 'plpgsql'
|
18
|
-
|
19
|
-
create_table :users do |t|
|
20
|
-
t.jsonb 'authorizy', default: {}
|
21
|
-
end
|
22
|
-
end
|