bscf-core 0.5.1 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97e08088e1eadf5769fe273dd705f7ea40c242cf9b026db81c1acbc666e06001
4
- data.tar.gz: d0a809772731e0c9dcbfcda98396bd626115b55e229051995785bd923a6ee3f6
3
+ metadata.gz: 6255829ced53f0037ef89fbdd21e174278e45e529177aaa22b82273c52d0e99e
4
+ data.tar.gz: 020eaa10c3a76b98567cb07d83a839e2c5c9bb695f391e45d14a30580cc8f43e
5
5
  SHA512:
6
- metadata.gz: 7ff38f31e064d4def263b71990fd42520dfa76194373c88cdcd797b3cf4db5270d6fffdf60c2ff97ffe172efa37a8cb57a8679fb63b71d782225875eb49b0791
7
- data.tar.gz: ac51ac7a5a006c84a480db4dac1dd940edf5fcb21ffa7ed962006c9f60285dc2bd628fb355310c7e1841e31f65e3597b43fd72aab307ad98b28a46bf01c2b37a
6
+ metadata.gz: b512af848cd267c9e8aacabecb924b3644238d50ac521c5a83e7ac496db07c09fae19e8a71fa84856e53380124b188e36472c8688289615e97319376eef5a59a
7
+ data.tar.gz: 390a3268dd83adb8402ac5f5794e60cab41b9344af35098b3e71c21b0adfc7d6fb24dde068ea6665a5b3b298bf75675d392dc89e15a11ea7c4c4f53f47b41cb9
@@ -1,22 +1,26 @@
1
- class ApplicationPolicy
2
- attr_reader :user, :record
1
+ module Bscf
2
+ module Core
3
+ class ApplicationPolicy
4
+ attr_reader :user, :record
3
5
 
4
- def initialize(user, record)
5
- @user = user
6
- @record = record
7
- end
6
+ def initialize(user, record)
7
+ @user = user
8
+ @record = record
9
+ end
8
10
 
9
- private
11
+ private
10
12
 
11
- def admin?
12
- user.user_roles.any? { |ur| ur.role.name == "Admin" }
13
- end
13
+ def admin?
14
+ user.user_roles.any? { |ur| ur.role.name == "Admin" }
15
+ end
14
16
 
15
- def driver?
16
- user.user_roles.any? { |ur| ur.role.name == "Driver" }
17
- end
17
+ def driver?
18
+ user.user_roles.any? { |ur| ur.role.name == "Driver" }
19
+ end
18
20
 
19
- def user_role?
20
- user.user_roles.any? { |ur| ur.role.name == "User" }
21
+ def user_role?
22
+ user.user_roles.any? { |ur| ur.role.name == "User" }
23
+ end
24
+ end
21
25
  end
22
26
  end
@@ -1,17 +1,21 @@
1
- class UserPolicy < ApplicationPolicy
2
- def index?
3
- admin?
4
- end
1
+ module Bscf
2
+ module Core
3
+ class UserPolicy < Bscf::Core::ApplicationPolicy
4
+ def index?
5
+ admin?
6
+ end
5
7
 
6
- def show?
7
- admin?
8
- end
8
+ def show?
9
+ admin?
10
+ end
9
11
 
10
- def by_role?
11
- admin?
12
- end
12
+ def by_role?
13
+ admin?
14
+ end
13
15
 
14
- def has_virtual_account?
15
- true
16
+ def has_virtual_account?
17
+ true
18
+ end
19
+ end
16
20
  end
17
21
  end
@@ -1,9 +1,13 @@
1
- class UserProfilePolicy < ApplicationPolicy
2
- def show?
3
- true
4
- end
1
+ module Bscf
2
+ module Core
3
+ class UserProfilePolicy < Bscf::Core::ApplicationPolicy
4
+ def show?
5
+ true
6
+ end
5
7
 
6
- def update_kyc?
7
- admin?
8
+ def update_kyc?
9
+ admin?
10
+ end
11
+ end
8
12
  end
9
13
  end
@@ -1,5 +1,9 @@
1
- class UserRolePolicy < ApplicationPolicy
2
- def assign_driver?
3
- admin?
1
+ module Bscf
2
+ module Core
3
+ class UserRolePolicy < Bscf::Core::ApplicationPolicy
4
+ def assign_driver?
5
+ admin?
6
+ end
7
+ end
4
8
  end
5
9
  end
@@ -1,5 +1,5 @@
1
1
  module Bscf
2
2
  module Core
3
- VERSION = "0.5.1"
3
+ VERSION = "0.5.2"
4
4
  end
5
5
  end
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asrat