ishapi 0.1.8.78 → 0.1.8.79

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: c563b9c230fd3f678cf74fe31328b361174b29bb
4
- data.tar.gz: 398de268e3bf644d5b4371fc6a801dc8be3882a7
3
+ metadata.gz: 6c33015b4db15d5e3e7ad0b6a23004868c412670
4
+ data.tar.gz: af6b758d4271adc70c7f79df1acb1bfe7a1e510e
5
5
  SHA512:
6
- metadata.gz: 8d526c5c998b8d93b0ed7055ea8a0ccfbb2a481dec2475d0b5249ade6909cc61d79fbb6360b0be6266752cb2e9e65d5b5f929318147e38050cca70110ad8a76e
7
- data.tar.gz: 8833c550fc895b3c7178ceedf6be12c7173f519c36a34381e7df1a4e432256a338215d6af116df3652f453058a3ae665fff5c96c2c89238acf1bbe7fa93507b6
6
+ metadata.gz: 2b52fb21ed4b8782ad4be0a4cf5832e947897ff5dcc45fd1d3f8be33513dd7c53f2bd1d07a69e107310b1230644bc28fd9e15644def6dfa557436af60d3b2356
7
+ data.tar.gz: 536fdffb20942365ddbbd08da456ef756176748028c4b12d3415642bbea599174858c58dfcdfe2ed931ca9079f7a4dcb9908ef06c81b959fcdfa186678ae73e5
@@ -2,7 +2,10 @@ module Ishapi
2
2
  class ApplicationController < ActionController::Base
3
3
  protect_from_forgery :prepend => true, :with => :exception
4
4
  layout :false
5
+
6
+ before_action :check_profile
5
7
  before_action :set_current_ability
8
+
6
9
  check_authorization
7
10
  skip_before_action :verify_authenticity_token
8
11
 
@@ -13,6 +16,10 @@ module Ishapi
13
16
 
14
17
  # this doesn't generate long-lived token, doesn't update user_profile
15
18
  def check_profile
19
+ # puts! params, 'params'
20
+ # puts! current_user, 'current_user'
21
+ # puts! @current_user, '@current_user'
22
+
16
23
  accessToken = request.headers[:accessToken]
17
24
  accessToken ||= params[:fb_long_access_token]
18
25
  accessToken ||= params[:accessToken]
@@ -26,6 +33,10 @@ module Ishapi
26
33
  @current_profile = @current_user.profile
27
34
  @current_order = @current_profile.current_order
28
35
  # orders.where( :submitted_at => nil ).first || ::CoTailors::Order.create( :profile_id => @current_profile.id )
36
+
37
+ ## for sedux
38
+ sign_in( @current_user )
39
+ puts! @current_user, '@current_user 222'
29
40
  end
30
41
 
31
42
  def set_profile
@@ -81,7 +92,8 @@ module Ishapi
81
92
  end
82
93
 
83
94
  def set_current_ability
84
- @current_ability ||= ::Ishapi::Ability.new( current_user )
95
+ puts! @current_user, '@current_user 111'
96
+ @current_ability ||= ::Ishapi::Ability.new( @current_user )
85
97
  end
86
98
 
87
99
  def puts! a, b=''
@@ -19,11 +19,11 @@ module Ishapi
19
19
 
20
20
 
21
21
  if @site.is_private
22
- if !params[:access_token]
22
+ if !params[:accessToken]
23
23
  render :json => { :status => :unauthorized}, :status => :unauthorized
24
24
  return
25
25
  end
26
- access_token = params[:access_token]
26
+ access_token = params[:accessToken]
27
27
  @graph = Koala::Facebook::API.new( access_token, ::FB[@site.domain][:secret] )
28
28
  @profile = @graph.get_object "me", :fields => 'email'
29
29
  if @site.private_user_emails.include?( @profile['email'] )
@@ -14,7 +14,7 @@ class Ishapi::Ability
14
14
  end
15
15
 
16
16
  can [ :show ], Gallery do |gallery|
17
- gallery.user == user
17
+ gallery.user_profile == user.profile
18
18
  end
19
19
 
20
20
  can [ :update ], ::CoTailors::Address do |address|
data/config/routes.rb CHANGED
@@ -17,8 +17,10 @@ Ishapi::Engine.routes.draw do
17
17
 
18
18
  get 'events/view/:eventname', :to => 'events#show'
19
19
 
20
- get 'galleries', :to => 'galleries#index'
21
- get 'galleries/view/:galleryname', :to => 'galleries#show'
20
+ get 'galleries', :to => 'galleries#index'
21
+ post 'galleries', :to => 'galleries#index'
22
+ get 'galleries/view/:galleryname', :to => 'galleries#show'
23
+ post 'galleries/view/:galleryname', :to => 'galleries#show'
22
24
 
23
25
  post 'invoices/search', :to => 'invoices#search'
24
26
 
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.78
4
+ version: 0.1.8.79
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-23 00:00:00.000000000 Z
11
+ date: 2018-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails