dscf-payment 0.2.2 → 0.2.3
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/lib/dscf/payment/version.rb +1 -1
- metadata +1 -2
- data/app/bypass/bypass.rb +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 49d8a9f9ef4ff6bbfc0b88f0bd0a52d00e12e73a04fb3acaf156c60cbba5a47a
|
|
4
|
+
data.tar.gz: 3cbaffd5759210001852782e9d832fa03c216697bce25ae810547f82afd22273
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c419642c8b68f145319f8ad321335adb5de27816704ade9a47041049357f0816b7515fa2f3a2859fb46c82e0c262a67fe8c2c3746175bd0501e333dc9f05483d
|
|
7
|
+
data.tar.gz: f41646a869b2e03d3169de73c490e681c699546eb86d1cd33c5bc237cc5e1a6dfe20ad990653661c0693f652d0291e559e0f88c8a0bd26126310de23155aa6e2
|
data/lib/dscf/payment/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dscf-payment
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Asrat
|
|
@@ -460,7 +460,6 @@ files:
|
|
|
460
460
|
- MIT-LICENSE
|
|
461
461
|
- README.md
|
|
462
462
|
- Rakefile
|
|
463
|
-
- app/bypass/bypass.rb
|
|
464
463
|
- app/controllers/concerns/bypass.rb
|
|
465
464
|
- app/controllers/dscf/payment/application_controller.rb
|
|
466
465
|
- app/controllers/dscf/payment/payment_requests_controller.rb
|
data/app/bypass/bypass.rb
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
module Dscf
|
|
2
|
-
module Banking
|
|
3
|
-
class ApplicationController < ActionController::API
|
|
4
|
-
include Dscf::Core::Authenticatable
|
|
5
|
-
include Dscf::Core::JsonResponse
|
|
6
|
-
before_action :authenticate_user
|
|
7
|
-
before_action :demo_bypass_permissions!
|
|
8
|
-
|
|
9
|
-
# TEMPORARY DEMO BYPASS:
|
|
10
|
-
# Bypass banking authorization checks for authenticated users only.
|
|
11
|
-
# Remove after the demo.
|
|
12
|
-
def bypass_permissions_for_demo?
|
|
13
|
-
true
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def pundit_user
|
|
17
|
-
user = current_user
|
|
18
|
-
return nil unless user
|
|
19
|
-
|
|
20
|
-
bypass_permissions_on_user!(user)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
def demo_bypass_permissions!
|
|
26
|
-
skip_authorization if respond_to?(:skip_authorization, true)
|
|
27
|
-
skip_policy_scope if respond_to?(:skip_policy_scope, true)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def bypass_permissions_on_user!(user)
|
|
31
|
-
return user if user.instance_variable_defined?(:@_banking_demo_permission_bypass)
|
|
32
|
-
|
|
33
|
-
user.define_singleton_method(:has_permission?) { |_permission_code| true }
|
|
34
|
-
user.define_singleton_method(:can?) { |permission_code| has_permission?(permission_code) }
|
|
35
|
-
user.define_singleton_method(:super_admin?) { true }
|
|
36
|
-
user.instance_variable_set(:@_banking_demo_permission_bypass, true)
|
|
37
|
-
|
|
38
|
-
user
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|