u-authorization 1.2.1 → 1.3.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/authorization.rb +4 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ec8f1983839a46911cc985c1d3a27fd56ac71d53135aec13025071ccde2af5a
4
- data.tar.gz: cf196505dea37701820b8a0a85d46b34c3091d556a622de4899f605ad8d30c22
3
+ metadata.gz: cc8fecb2d5a29b122d38861e2e46827f8a295b2017bc19fa60a2a1884e456e8b
4
+ data.tar.gz: c81528a10a0c2afea7e28be3a654164d712da8afc64be27ca3c8dcb7d48490c7
5
5
  SHA512:
6
- metadata.gz: a872b99a0300a3742e383895bbefe4bb51d7d94599280ea2a8c0670d89bcab7e5a8c9ebb8b537a4e5b5c58795103f7a82289c6cc8160273f65ada32dfd14029f
7
- data.tar.gz: 5819bc7367619be3a9032540848592aac4c2dd283f918df538fabd061986c0b89534916159d09a7edcd38a65a01ae9cf147fb66f8792d841440560b439d9cecd
6
+ metadata.gz: 22252cb37716d9646e79a6f1b777848f470615b759c9fee13442d1f676caf76ef0c9d0da0413801f395814ceefea15e66bf75e0152ec01726d893770514f0f81
7
+ data.tar.gz: 70b2ecae75be81b47e3452820a28eda59a4e731341ed3c65564bbe975a84228f32e037523c418342a4cd21ebefdf85dc83f594eb1e65b3271d2bbc6ed4896321
data/authorization.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Authorization
4
- VERSION = '1.2.1'
4
+ VERSION = '1.3.0'
5
5
 
6
6
  MapValuesAsDowncasedStrings = -> (values) do
7
7
  Array(values).map { |value| String(value).downcase }
@@ -20,7 +20,9 @@ module Authorization
20
20
  def has_permission?(context, role_permission)
21
21
  return false if role_permission.nil?
22
22
 
23
- if !(any = role_permission['any']).nil?
23
+ if role_permission == false || role_permission == true
24
+ role_permission
25
+ elsif !(any = role_permission['any']).nil?
24
26
  any
25
27
  elsif only = role_permission['only']
26
28
  check_feature_permission(only, context)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: u-authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Serradura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-23 00:00:00.000000000 Z
11
+ date: 2018-12-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Simple authorization library and role managment for Ruby.
14
14
  email: rodrigo.serradura@gmail.com