ishapi 0.1.8.177 → 0.1.8.178
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ishapi/maps_controller.rb +2 -0
- data/app/controllers/ishapi/newsitems_controller.rb +16 -2
- data/app/models/ishapi/ability.rb +8 -2
- data/app/views/ishapi/maps/show.jbuilder +4 -0
- data/app/views/ishapi/newsitems/_index.jbuilder +1 -1
- data/app/views/ishapi/tags/_index.jbuilder +1 -0
- data/config/routes.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 624ac9590f37f623390c3d985f6cdef76ce0ac93b4f35d7c9e3556412a27f75e
|
4
|
+
data.tar.gz: 8bc5cbd36d9b8cfbcb5af703841ad320787157e82ad9a7da47bba609eb674d35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c606ff431e7cbf34b57f303c111cb479ef420f7b9527c4290f51ad0dccb8e4a6e9e17df4725b28efc673bb445c2755040d07fcd5aac90da8b7597cdc203d1317
|
7
|
+
data.tar.gz: 2e6980d59dc035a5ad4e4928388f17feb5d02b6f70b240ec5818f2c9e1a20151a26f34cf9b12a8bcd28c5f30023ad5d8d479cd77b46acf79513e64f3d8d92cbc
|
@@ -13,6 +13,8 @@ class Ishapi::MapsController < Ishapi::ApplicationController
|
|
13
13
|
|
14
14
|
@markers = @map.markers.permitted_to(current_user.profile)
|
15
15
|
|
16
|
+
@tags = @map.tags
|
17
|
+
|
16
18
|
# case @map.ordering_type
|
17
19
|
# when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
|
18
20
|
# @markers = @markers.order_by( name: :asc )
|
@@ -3,8 +3,22 @@ require_dependency "ishapi/application_controller"
|
|
3
3
|
module Ishapi
|
4
4
|
class NewsitemsController < ApplicationController
|
5
5
|
|
6
|
-
before_action :check_profile
|
7
|
-
|
6
|
+
before_action :check_profile
|
7
|
+
|
8
|
+
def destroy
|
9
|
+
n = Newsitem.find params[:id]
|
10
|
+
|
11
|
+
puts! n.map.creator_profile.id, 'ze id'
|
12
|
+
puts! current_user.profile.id, 'ze2 id'
|
13
|
+
|
14
|
+
authorize! :destroy, n
|
15
|
+
flag = n.destroy
|
16
|
+
if flag
|
17
|
+
render json: { status: 'ok' }, status: :ok
|
18
|
+
else
|
19
|
+
render json: { message: "No luck: #{n.errors.full_messages.join(", ")}." }, status: 400
|
20
|
+
end
|
21
|
+
end
|
8
22
|
|
9
23
|
def index
|
10
24
|
if params[:domain]
|
@@ -6,7 +6,7 @@ class Ishapi::Ability
|
|
6
6
|
#
|
7
7
|
# signed in user
|
8
8
|
#
|
9
|
-
|
9
|
+
if !user.blank?
|
10
10
|
|
11
11
|
# if user.profile && user.profile.sudoer?
|
12
12
|
# can :manage, :all
|
@@ -14,7 +14,9 @@ class Ishapi::Ability
|
|
14
14
|
|
15
15
|
can [ :my_index ], Gallery
|
16
16
|
can [ :show ], Gallery do |gallery|
|
17
|
-
gallery.user_profile == user.profile
|
17
|
+
gallery.user_profile == user.profile || # my own
|
18
|
+
(!gallery.is_trash && gallery.is_public ) || # public
|
19
|
+
(!gallery.is_trash && gallery.shared_profiles.include?( user.profile ) ) # shared with me
|
18
20
|
end
|
19
21
|
|
20
22
|
can [ :do_purchase ], ::Gameui
|
@@ -22,6 +24,10 @@ class Ishapi::Ability
|
|
22
24
|
map.creator_profile == user.profile
|
23
25
|
end
|
24
26
|
|
27
|
+
can [ :destroy ], Newsitem do |n|
|
28
|
+
n.map.creator_profile.id == user.profile.id
|
29
|
+
end
|
30
|
+
|
25
31
|
can [ :create, :unlock ], ::Ish::Payment
|
26
32
|
|
27
33
|
can [ :buy_stars ], ::Ish::UserProfile
|
data/config/routes.rb
CHANGED
@@ -29,6 +29,9 @@ Ishapi::Engine.routes.draw do
|
|
29
29
|
post 'videos', to: 'videos#index'
|
30
30
|
end
|
31
31
|
|
32
|
+
# N
|
33
|
+
delete 'newsitems/:id', to: 'newsitems#destroy'
|
34
|
+
|
32
35
|
post 'do_purchase', to: 'gameui#do_purchase' # @TODO: rename to just purchase, or destroy endpoint
|
33
36
|
post 'payments', :to => 'payments#create'
|
34
37
|
post 'payments2', :to => 'payments#create2' # @TODO: change
|
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.
|
4
|
+
version: 0.1.8.178
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|