shopapp 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20d46c43bba283b3d2a3abda46048b8b0e55f1c1f73070f84c2af1ec1b84d5c5
4
- data.tar.gz: 320def0a006db8f0d21388a31c1dcd1df78d51c307d5c639af1a94630ab4d99b
3
+ metadata.gz: 1efb4ab69d027b53cc22882935a5c376247a8884612e842b2d47f3c55cbcc6b3
4
+ data.tar.gz: 4e8474a4232daac45e29f069ab23e68db9f4d44de01c3d6505d6b182ace8b69f
5
5
  SHA512:
6
- metadata.gz: 6b1843c4265d331d351da3f35e3d9b10d14cfb8b7400a0519bf8cb6d8986ac8139ec5af3eeba6988b86d8063fee1dee1881ac5594ac7621df3e7c0b559b2fa75
7
- data.tar.gz: 1694787c6c6b52cded3499723e38883f24181dadbbe3c499851b436718a9e8e30618078a45b59bc5b02bfb82466ba05080048e4a38796d55aa85df5e8fde3f91
6
+ metadata.gz: 3a296df9c3ce2d60d9ddf1c1c779f232f73bc9aca5acaae37609136c7e72358f8e9bc68fb96da7d69ca9548f9fcdcd078954469d4de240036bc9288587a8ef7b
7
+ data.tar.gz: 8afc7bd7b044c24085ecf96c190f610de546418959a0a363327ee0e4ef27c3c8eaa5bb8d1a722b04317e0e6ad711d5ee0890be631c8543ebd70db348053bad90
@@ -97,7 +97,11 @@ module ShopliftClient
97
97
  begin
98
98
  x = srv.get '/api/users/profile'
99
99
  @current_user_json_hash = @current_user = JSON.parse x.response.body
100
- user_scopes = JSON.parse @current_user['scopes']
100
+ unless @current_user['scopes'].is_a? String
101
+ user_scopes = @current_user['scopes']
102
+ else
103
+ user_scopes = JSON.parse @current_user['scopes']
104
+ end
101
105
  unless user_scopes.include? 'admin'
102
106
  (self.class.required_scopes || []).each do |required_scope|
103
107
  unless user_scopes.include? required_scope
@@ -1,6 +1,10 @@
1
1
  module ShopappHelper
2
2
  def user_allowed?(scope)
3
- user_scopes = JSON.parse @current_user['scopes']
3
+ unless @current_user['scopes'].is_a? String
4
+ user_scopes = @current_user['scopes']
5
+ else
6
+ user_scopes = JSON.parse @current_user['scopes']
7
+ end
4
8
  user_scopes.include?('admin') || user_scopes.include?(scope.to_s)
5
9
  end
6
10
 
@@ -47,8 +47,16 @@
47
47
  .sidebar-sticky
48
48
  = render 'layouts/sidebar'
49
49
  %main.col-md-10.ml-sm-auto.col-lg-10.px-4.mt-2{:role => "main"}
50
+ - if notice
51
+ .alert.alert-secondary.mt-3(role="alert")= notice
52
+ - if alert
53
+ .alert.alert-danger.mt-3(role="alert")= alert
50
54
  = yield
51
55
  - else
52
56
  .row
53
57
  %main.col.px-4.mt-2{:role => "main"}
58
+ - if notice
59
+ .alert.alert-secondary.mt-3(role="alert")= notice
60
+ - if alert
61
+ .alert.alert-danger.mt-3(role="alert")= alert
54
62
  = yield
data/shopapp.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopapp'
3
- s.version = '0.2.8'
4
- s.date = '2018-09-27'
3
+ s.version = '0.2.9'
4
+ s.date = '2018-09-28'
5
5
  s.summary = 'Do a shoplift.'
6
6
  s.description = 'Ha! Art thou Bedlam? Dost thou thirst base Trojan, to have me fold up Parca\'s fatal web? Hence!\
7
7
  I am qualmish at the smell of leek.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2018-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties