active_permission 0.2.1 → 0.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7884c2a9df82a44420cf0cae72f544f8cfbe198
|
4
|
+
data.tar.gz: be5626d3cb6929fdb3b1331e0e6128f7c3a65aa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 741dc75811de73cb9115300c8ca614497df861354a35dc4774dbf6d381f5ea21ed4ba1e3ed23a7333280480f5637e30e29829d198e5ea95cc2aa2a5a326f8e16
|
7
|
+
data.tar.gz: 4d26ab693249a1af351c17083d91e26decbb5ce75e1fd9c4c187c84d115ebe9354b04b3b108d1119bcb4d55cb921093cbe406702f40c24c11b7fe16428b880ba
|
data/lib/active_permission.rb
CHANGED
@@ -3,6 +3,7 @@ require 'active_permission/controller_additions'
|
|
3
3
|
require 'active_permission/base'
|
4
4
|
|
5
5
|
module ActivePermission
|
6
|
+
class MissingParameter < RuntimeError ; end
|
6
7
|
class AccessDenied < RuntimeError
|
7
8
|
attr_reader :controller, :action, :resources
|
8
9
|
def initialize(controller = nil , action = nil , resources = nil)
|
@@ -49,7 +49,7 @@ module ActivePermission
|
|
49
49
|
if options[:through] and options[:association]
|
50
50
|
object = instance_variable_get("@#{options[:through]}").send(options[:association])
|
51
51
|
elsif options[:object].nil?
|
52
|
-
raise
|
52
|
+
raise MissingParameter.new('Please add parameter :object to resource')
|
53
53
|
elsif options[:object].kind_of? Symbol
|
54
54
|
object = send(options[:object])
|
55
55
|
elsif options[:object].kind_of? String
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_permission
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Shurmin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.4.5
|
108
|
+
rubygems_version: 2.4.5.1
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: This gem allow you load and authorize resource in Ruby on Rails inside controllers
|