gb_mapfish_appserver 1.0.4 → 1.0.5
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 +8 -8
- data/app/controllers/geo_controller.rb +2 -2
- data/app/models/geo_model.rb +8 -2
- data/app/models/user.rb +9 -1
- data/lib/gb_mapfish_appserver/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2VlMzQ0NmQzYjJhMTA0ZmYwMWY4OGE4MmUzMTI4ZGFlMDJmZmVhOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmIxZmI0NGNjMzU5ZDVlOGE3ODE1MTU1ZDNhZmVlMTU3YjU2NWQ2Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDRiOGFiYzU5Y2I5NGQ4ZGY4NDdjNDllMWViZDAzMGU2MTI0YjJiNzhmOTU3
|
10
|
+
M2UzNWZlMzc5NGNmZWRiYjdmYTUwNjUzMjBlZDc3ZTAwZjJhYjZlYTkwNWQ2
|
11
|
+
NjJmMDVlZDdkNDk3ZWExZTdlMWZkM2EyYWZlY2IxNDkxMzkxYTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWRmNTBmNjIxMWZhYzk4ZWM2YWE3MWQ4NDc4MmIxY2U4MDYxMWFmMzAxNDg1
|
14
|
+
MTFlYjM1ZTliM2RmYzYyZmVhNzgwOTE2NGFiMDlhNDQyYzQ2NmY0ZjQyMTdh
|
15
|
+
MGIwY2Y1NGNlNzExZTE1ZTA5OGM5ZmUwOGM5MjgxNmY1ZDY4MzU=
|
@@ -53,14 +53,14 @@ class GeoController < ApplicationController
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def update
|
56
|
-
feature = geo_model.
|
56
|
+
feature = geo_model.geojson_decode(request.raw_post)
|
57
57
|
if feature.nil?
|
58
58
|
head :bad_request
|
59
59
|
return
|
60
60
|
end
|
61
61
|
|
62
62
|
if feature.feature_id.is_a? Integer
|
63
|
-
@feature = geo_model.
|
63
|
+
@feature = geo_model.user_filter(current_ability).find_by_id(feature.feature_id)
|
64
64
|
end
|
65
65
|
if @feature.nil?
|
66
66
|
head :not_found
|
data/app/models/geo_model.rb
CHANGED
@@ -84,8 +84,14 @@ class GeoModel < ActiveRecord::Base
|
|
84
84
|
#end
|
85
85
|
|
86
86
|
def bbox
|
87
|
-
|
88
|
-
|
87
|
+
box_query = "Box2D(#{connection.quote_column_name(self.class.geometry_column_name)})"
|
88
|
+
extent = self.class.select("ST_XMin(#{box_query}), ST_YMin(#{box_query}), ST_XMax(#{box_query}), ST_Ymax(#{box_query})").find(id)
|
89
|
+
[
|
90
|
+
extent.st_xmin.to_f,
|
91
|
+
extent.st_ymin.to_f,
|
92
|
+
extent.st_xmax.to_f,
|
93
|
+
extent.st_ymax.to_f
|
94
|
+
]
|
89
95
|
end
|
90
96
|
|
91
97
|
# based on mapfish_filter
|
data/app/models/user.rb
CHANGED
@@ -25,7 +25,15 @@ class User < ActiveRecord::Base
|
|
25
25
|
before_create :add_requested_group
|
26
26
|
|
27
27
|
def has_role?(rolename)
|
28
|
-
roles.any? { |role| role.name == rolename.to_s }
|
28
|
+
has_role = roles.any? { |role| role.name == rolename.to_s }
|
29
|
+
unless has_role
|
30
|
+
# check roles from groups
|
31
|
+
groups.each do |group|
|
32
|
+
has_role = group.roles.any? { |role| role.name == rolename.to_s }
|
33
|
+
break if has_role
|
34
|
+
end
|
35
|
+
end
|
36
|
+
has_role
|
29
37
|
end
|
30
38
|
|
31
39
|
def group_admin?(group)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gb_mapfish_appserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pirmin Kalberer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|