ishapi 0.1.8.80 → 0.1.8.81

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
  SHA1:
3
- metadata.gz: 5d2dffc58f4528aafdc2ba43d7b99392e1504d31
4
- data.tar.gz: d5492e43e9551088b1ccbfed57e4db87dc5cd63a
3
+ metadata.gz: fc534cf07322696ddae09e7df8c1084897f186de
4
+ data.tar.gz: 91b9a27b912e2aa692880c8f4c697492a49f3f8b
5
5
  SHA512:
6
- metadata.gz: da797aba4eb322ff565dac9986b5f398684847f5255051d5fe4584a141024e30aac77b6097af40688b2d8e6120238ad2ac92bd63e3363f361ce95b45ce0166f5
7
- data.tar.gz: 52f57a19fafce1d8c331a469b275c64888cf82931cbcf1ac6023c05de44c17866421903734ec6c7e107e86aae377da5cd7832ec3560d86fae173e389079f8fb1
6
+ metadata.gz: ff5e4672c321cba19f1a7a31d6f9d9b3a10cb2de088fbda91667f6770933a5b7bcdc5618acad429f31aa0c00017a97cbb35702bbe77a7655941d12945019aa27
7
+ data.tar.gz: 80f8ec92dc38eb0d330f7bd1264bdcb55e003dbe2006df67efa779309093d564c8694d9c8b650d2198e6e294941ab817b35fbe6fdd2d93b5e6d226fbf92fe382
@@ -1,7 +1,7 @@
1
1
  require_dependency "ishapi/application_controller"
2
2
 
3
3
  module Ishapi
4
- class ApiController < ApplicationController
4
+ class ApiController < UnrestrictedController
5
5
 
6
6
  def home
7
7
  authorize! :welcome_home, Ishapi
@@ -36,7 +36,7 @@ module Ishapi
36
36
 
37
37
  ## for sedux
38
38
  sign_in( @current_user )
39
- puts! @current_user, '@current_user 222'
39
+ # puts! @current_user, '@current_user 222'
40
40
  end
41
41
 
42
42
  def set_profile
@@ -1,7 +1,13 @@
1
1
  require_dependency "ishapi/application_controller"
2
2
 
3
3
  module Ishapi
4
- class CitiesController < ApplicationController
4
+ class CitiesController < UnrestrictedController
5
+ protect_from_forgery :prepend => true, :with => :exception
6
+ layout :false
7
+
8
+ check_authorization
9
+ skip_before_action :verify_authenticity_token
10
+ before_action :set_current_ability
5
11
 
6
12
  def index
7
13
  authorize! :index, City
@@ -18,5 +24,14 @@ module Ishapi
18
24
  authorize! :show, @city
19
25
  end
20
26
 
27
+
28
+ private
29
+
30
+
31
+
32
+ def set_current_ability
33
+ @current_ability ||= ::Ishapi::Ability.new( User.new )
34
+ end
35
+
21
36
  end
22
37
  end
@@ -0,0 +1,25 @@
1
+ module Ishapi
2
+ class UnrestrictedController < ActionController::Base
3
+ protect_from_forgery :prepend => true, :with => :exception
4
+ layout :false
5
+
6
+ before_action :set_current_ability
7
+
8
+ check_authorization
9
+ skip_before_action :verify_authenticity_token
10
+
11
+
12
+ private
13
+
14
+
15
+ def set_current_ability
16
+ @current_ability ||= ::Ishapi::Ability.new( User.new )
17
+ end
18
+
19
+ def puts! a, b=''
20
+ puts "+++ +++ #{b}"
21
+ puts a.inspect
22
+ end
23
+
24
+ end
25
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.80
4
+ version: 0.1.8.81
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-07 00:00:00.000000000 Z
11
+ date: 2018-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -199,6 +199,7 @@ files:
199
199
  - app/controllers/ishapi/reports_controller.rb
200
200
  - app/controllers/ishapi/sites_controller.rb
201
201
  - app/controllers/ishapi/tags_controller.rb
202
+ - app/controllers/ishapi/unrestricted_controller.rb
202
203
  - app/controllers/ishapi/user_profiles_controller.rb
203
204
  - app/controllers/ishapi/users_controller.rb
204
205
  - app/controllers/ishapi/venues_controller.rb