adeia 0.7.0 → 0.7.1

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: f5ff162eec4ae039ed179640b7b12f1a3debfba1
4
- data.tar.gz: b1f6c80b249c9f56eb359365454d471c6d9a1242
3
+ metadata.gz: ee20a9e9c343ca52486c9c554eb9ee3d1f7635df
4
+ data.tar.gz: 8b5f9c19b76798f79f498900dc6d4151f798533a
5
5
  SHA512:
6
- metadata.gz: 6b0472240c46185ec67431fae5642e50b44a209747ddedb5367ad6fe9fe4aeda474cbcdd79962d901287a5b42296a2073a6dabf3d5168a9fd1d1663d75a62c07
7
- data.tar.gz: 5e2a12e1c53e03ab859664b72f26844792629ba5c14278ad0aee6f3cd242c216cebb95bad9a67bfd2d16d5ad831bbe966b18ab8bfa1caf81136ad718db1f55b9
6
+ metadata.gz: b1b254b0414a89c7ae7541f7c9143b5278cb27395c15f157e4df20cc23dabfcd9c5b1a51aba97dd80c76f18b87468ac9de9287deed2eb017530d8caa24c091a8
7
+ data.tar.gz: bf768dcc26b543688f5dbb85633a9538646afd09191cef51d4e0b771253ab3abb6c71db69421afd834bd67be6139482274821158bcf9c5b5f28a7b7426cf8721
@@ -6,10 +6,10 @@ module Adeia
6
6
  class Authorization < Database
7
7
 
8
8
  def authorize!
9
- rights = token_rights(right_name)
10
- raise LoginRequired if rights[:rights].empty? && @user.nil?
11
- rights = rights.merge(send("#{right_name}_rights")) { |key, v1, v2| v1 + v2 } if @user
12
- @rights, @resource_ids = rights[:rights], rights[:resource_ids]
9
+ token_rights = token_rights(right_name)
10
+ raise LoginRequired if token_rights[:rights].empty? && @user.nil?
11
+ action_rights = @user.nil? ? {} : send("#{right_name}_rights")
12
+ merge_permissions(token_rights, action_rights)
13
13
  raise AccessDenied unless @rights.any? && authorize?
14
14
  end
15
15
 
data/lib/adeia/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Adeia
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end