ishapi 0.1.8.83 → 0.1.8.84

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
  SHA1:
3
- metadata.gz: c22c41737e78d85f38ead0dc843eac965b1c11b0
4
- data.tar.gz: 141c7e5a2e81500d4b08f6fd7876d6392e561704
3
+ metadata.gz: 580afca9946792fc16b0e740aeebe5e668ab4475
4
+ data.tar.gz: b1dbcf23e708cbd6e9ed6239ca08c358cf3e675e
5
5
  SHA512:
6
- metadata.gz: aff1b18b46bfb174b4031fb2b45c725ff486c6c3cfa0ce49dea49595fa6a5d0367bfaa6163e197284024747e8ca34ef02d2c7878c81c0aec380b017226b8d5c6
7
- data.tar.gz: ca4d464cf29f296762848c249854b2e72c5027c2e4985850de4404aff2746608a996d6bedbccd1aaa3980e9a34291e783dd48f10977587f69159703eb705d55a
6
+ metadata.gz: 679fea13081466918b96a8e5766d124f99fc212a97c68f16e6d024f6fc945bab89466fea8e75fab0f25edcd1f21225944e98cd6cbe365a7ec34220730d2f3c3c
7
+ data.tar.gz: 15724413ffc4b8b4fc878dde5c28740536f871999c39125607fab5a34557b1417cd454fa3c39ff6f59ce789a3391906b485892387a249764d2a5bcd0882d340c
@@ -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
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.83
4
+ version: 0.1.8.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -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