pusher-chatkit-server 0.5.1 → 0.5.2

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: c3a7278828c729e0a89fde04edb9e75b94b72b91
4
- data.tar.gz: 8715360652c89f7a70e1058951012410cf35ea22
3
+ metadata.gz: 37592f1a6903855a94ed94aa6237173dde98a8d8
4
+ data.tar.gz: 7b925a5803a3212e91441cbdde1798bfd2e3a372
5
5
  SHA512:
6
- metadata.gz: dfcf2fb6fbbfbcc4d6f78349175dc4eceda2741c051acc174e39383450cbb452f0a9a6ad765770895c9cbb704892483855aaa08ba69dcf5adaf63704e1c58f25
7
- data.tar.gz: 9c33e178b6551a7d1cbd95cb68d5d9a0fd58da2c542aaf15820aa2b0d6880bb2d043031697adb2c94bec3b2f11e4191a4bec320a9c2a139b3a2234dfe7c926c5
6
+ metadata.gz: 37138a87cde677cf4d99fb8d1272a914c099e0d53c7daa1d6eeb8c767ccbfba8af3c8ba2199db8874c7d66f5114e6837abdbaf1f7eb5033e65e017dc2c37a901
7
+ data.tar.gz: 55020628029e9d9b60fe590d77796a6d5d94973e94c39f0d08ce62bacd6dd18266eda8551d2e5e46a68dd547d2cf2cd46204e9d7b3a48d03388b3841f8d67eed
@@ -207,8 +207,8 @@ module Chatkit
207
207
  get_permissions_for_role(role_name, ROOM_SCOPE)
208
208
  end
209
209
 
210
- def update_role_permissions(role_name, scope, permissions_to_add, permissions_to_remove)
211
- check_permissions(permissions_to_add+permissions_to_remove)
210
+ def update_role_permissions(role_name, scope, permissions_to_add = [], permissions_to_remove = [])
211
+ check_permissions(permissions_to_add+permissions_to_remove, scope)
212
212
 
213
213
  if permissions_to_add.empty? && permissions_to_remove.empty?
214
214
  raise Chatkit::Error.new("permissions_to_add and permissions_to_remove cannot both be empty")
@@ -232,7 +232,7 @@ module Chatkit
232
232
  private
233
233
 
234
234
  def create_role(name, scope, permissions)
235
- check_permissions(permissions)
235
+ check_permissions(permissions, scope)
236
236
 
237
237
  @authorizer_instance.request(
238
238
  method: "POST",
@@ -303,7 +303,7 @@ module Chatkit
303
303
  JSON.parse(resp.body)
304
304
  end
305
305
 
306
- def check_permissions(permissions)
306
+ def check_permissions(permissions, scope)
307
307
  permissions.each do |permission|
308
308
  unless VALID_PERMISSIONS[scope.to_sym].include?(permission)
309
309
  raise Chatkit::Error.new("Permission value #{permission} is invalid")
@@ -19,6 +19,8 @@ module Chatkit
19
19
  GET_USER_ROOMS = "user:rooms:get"
20
20
  CREATE_FILE = "file:create"
21
21
  GET_FILE = "file:get"
22
+ CURSOR_READ_GET = "cursors:read:get"
23
+ CURSOR_READ_SET = "cursors:read:set"
22
24
 
23
25
  VALID_PERMISSIONS = {
24
26
  room: [
@@ -32,7 +34,9 @@ module Chatkit
32
34
  CREATE_TYPING_EVENT,
33
35
  GET_ROOM_MESSAGES,
34
36
  CREATE_FILE,
35
- GET_FILE
37
+ GET_FILE,
38
+ CURSOR_READ_GET,
39
+ CURSOR_READ_SET
36
40
  ],
37
41
  global: [
38
42
  JOIN_ROOM,
@@ -51,7 +55,9 @@ module Chatkit
51
55
  GET_ROOM,
52
56
  GET_USER_ROOMS,
53
57
  CREATE_FILE,
54
- GET_FILE
58
+ GET_FILE,
59
+ CURSOR_READ_GET,
60
+ CURSOR_READ_SET
55
61
  ]
56
62
  }
57
- end
63
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pusher-chatkit-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pusher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-09 00:00:00.000000000 Z
11
+ date: 2018-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pusher-platform