bscf-core 0.4.99 → 0.5.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/app/controllers/bscf/core/application_controller.rb +6 -0
- data/app/policies/user_policy.rb +17 -0
- data/app/policies/user_profile_policy.rb +9 -0
- data/app/policies/user_role_policy.rb +5 -0
- data/lib/bscf/core/engine.rb +1 -0
- data/lib/bscf/core/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 225894f65a8e151960ff603ac227cc575754eae6ab1c146ee20542091fa129a5
|
4
|
+
data.tar.gz: e9f6a8a6f912ef97dcfe6fc718deae1204d26a17a93995abc369604b6fa4aab2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c1d6726242a8153d72662522730397733670e19ace435ac032521bfab747ee559bcdd9ae3a65d8480d80676a22e907b68504b1f2b6a8a1af76107c8da69e2f9
|
7
|
+
data.tar.gz: 01ad96461f4a1f3de25e67b6b361079de48411cdb6748ffc9654040fc67db27bdbba1928e572ef1066ee875834ed73e6652154badf7d68a6a413f94624a8376b
|
@@ -3,8 +3,14 @@ module Bscf
|
|
3
3
|
class ApplicationController < ActionController::API
|
4
4
|
include Pundit::Authorization
|
5
5
|
|
6
|
+
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
|
7
|
+
|
6
8
|
private
|
7
9
|
|
10
|
+
def user_not_authorized
|
11
|
+
render json: { error: "You are not authorized to perform this action." }, status: :unauthorized
|
12
|
+
end
|
13
|
+
|
8
14
|
def is_authenticated
|
9
15
|
render json: { error: "Not authenticated" }, status: :unauthorized unless current_user
|
10
16
|
end
|
data/lib/bscf/core/engine.rb
CHANGED
data/lib/bscf/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bscf-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asrat
|
@@ -331,6 +331,9 @@ files:
|
|
331
331
|
- app/models/bscf/core/voucher.rb
|
332
332
|
- app/models/bscf/core/wholesaler_product.rb
|
333
333
|
- app/policies/application_policy.rb
|
334
|
+
- app/policies/user_policy.rb
|
335
|
+
- app/policies/user_profile_policy.rb
|
336
|
+
- app/policies/user_role_policy.rb
|
334
337
|
- app/services/bscf/core/gebeta_maps_service.rb
|
335
338
|
- app/services/bscf/core/token_service.rb
|
336
339
|
- app/services/bscf/core/transaction_service.rb
|