ibrain-core 0.2.3 → 0.2.7

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: 9c01fb318f3aa91812d1bfa1e71f956260a51929f05bfe5a6ae642149f8219ba
4
- data.tar.gz: d15d09f9e9b6761d2ab5424a04b1c12185898493034683a5394a482041e59f73
3
+ metadata.gz: 4cac7d792f031d619eb2b5c038fdfc79d418ab1ade813d6b0e152b69a6d455cc
4
+ data.tar.gz: 50c8c54f553d9e06f67b84a2bbb37c535cf556d0f100982ca249fb6cd924ebc5
5
5
  SHA512:
6
- metadata.gz: 4fd557d32f5ccdedcf916bccc2b3fd9d9af87a344276b9142946b9008b5b9681343801e80579a3564055b78c784cadf864a02faf014f1adddb423ad8d0c9b4da
7
- data.tar.gz: b2c18c0af1ab23dab608e93e8a6634d23a5c90d21eb734320aabf9a6b3e4f99afc01557b5c7633b5cf10eecb1ec0a827e133bdd65e3124544bd6cd83566ae5a7
6
+ metadata.gz: b71f8954bd35b5c1c3ca9a8c55014396bcca1f973d1a46a7767c325486070d9db57df268ea3dbf65a96848e7b1c2c14576de15e4e24cce82e0273e7627d5cab9
7
+ data.tar.gz: 23126f7c61e570aa257aaa30197c408f9726aced6b94068b00d94d089d63884ca4ea8a5356b662e45c8b6564318497d52ac0a5f5844dd70b5b988bad5679fede
@@ -4,10 +4,10 @@ module Ibrain
4
4
  class BaseSchema < ::GraphQL::Schema
5
5
  use GraphQL::Batch
6
6
 
7
- use GraphQL::Guard.new(
8
- policy_object: ::Ibrain::Config.graphql_policy.safe_constantize,
9
- not_authorized: ->(type, field) { raise IbrainErrors::PermissionError.new("You not have permission to access #{type}.#{field}") }
10
- )
7
+ # use GraphQL::Guard.new(
8
+ # policy_object: ::Ibrain::Config.graphql_policy.safe_constantize,
9
+ # not_authorized: ->(type, field) { raise IbrainErrors::PermissionError.new("You not have permission to access #{type}.#{field}") }
10
+ # )
11
11
 
12
12
  # Union and Interface Resolution
13
13
  def self.resolve_type(_abstract_type, _obj, _ctx)
@@ -3,11 +3,10 @@
3
3
  module Ibrain
4
4
  module Extentions
5
5
  class Roles < GraphQL::Schema::FieldExtension
6
- def after_resolve(object:, arguments:, **rest)
6
+ def after_resolve(object:, value:, **_rest)
7
7
  raise IbrainErrors::PermissionError.new("You not have permission to access #{field&.name}") if is_invalid_role(object)
8
8
 
9
- # yield the current time as `memo`
10
- yield(object, arguments, rest)
9
+ value
11
10
  end
12
11
 
13
12
  private
@@ -20,6 +19,8 @@ module Ibrain
20
19
  return if roles.blank?
21
20
  return true if current_user.blank?
22
21
  return false if roles.include?(role)
22
+
23
+ true
23
24
  end
24
25
  end
25
26
  end
@@ -3,6 +3,8 @@
3
3
  module Ibrain
4
4
  module Resolvers
5
5
  class BaseResolver < GraphQL::Schema::Resolver
6
+ argument_class ::Ibrain::Types::BaseArgument
7
+
6
8
  argument :filter, Ibrain::Types::FilterType, required: false, default_value: nil
7
9
  argument :limit, Int, required: false, default_value: 10
8
10
  argument :offset, Int, required: false, default_value: 0
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibrain
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.7"
5
5
 
6
6
  def self.ibrain_version
7
7
  VERSION
8
8
  end
9
9
 
10
10
  def self.previous_ibrain_minor_version
11
- '0.2.2'
11
+ '0.2.6'
12
12
  end
13
13
 
14
14
  def self.ibrain_gem_version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibrain-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tai Nguyen Van
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2022-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-session_store