cancancan_masquerade 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +55 -0
- data/LICENSE.txt +21 -0
- data/README.md +135 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/rspec +29 -0
- data/bin/setup +8 -0
- data/cancancan_masquerade.gemspec +35 -0
- data/lib/cancancan/masquerade.rb +16 -0
- data/lib/cancancan/masquerade/inherit_permissions.rb +57 -0
- data/lib/cancancan/masquerade/version.rb +9 -0
- data/lib/cancancan_masquerade.rb +1 -0
- metadata +134 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 46d1d6c061c49c53bd5f9fe15d7bdf26d684090da709509a7de632e547bb2b4d
|
4
|
+
data.tar.gz: 46ac209d484ee033ddd460ab7634247b7268e766c1957a27f52b67dbcdfa88db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6cacf3cf74d09354695f0b036c6a932606b18e57e95ae08f7878195a4d90c36ed684f31e5de8c78faf4545872c53f2bcc1f9d009373ed9c54da0cceaea520a43
|
7
|
+
data.tar.gz: 61e08e5aacbea22e12b08f57eab2b23d8ac2d2ac8cf736bf5a6d86b2861d3a5bfd35ddf169a372836840823671d4494b6620ead5b860f2a5d37d224553976349
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, sexual identity and orientation,
|
10
|
+
or any other criteria, as decided by the community.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at chall8908@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
# ruby=ruby-2.5.1
|
6
|
+
# ruby-gemset=cancancan_masquerade
|
7
|
+
|
8
|
+
# Specify your gem's dependencies in cancancan_masquerade.gemspec
|
9
|
+
gemspec
|
10
|
+
|
11
|
+
require 'cancancan'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cancancan_masquerade (0.1.0)
|
5
|
+
cancancan (~> 2.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.0)
|
11
|
+
cancancan (2.3.0)
|
12
|
+
diff-lcs (1.3)
|
13
|
+
jaro_winkler (1.5.1)
|
14
|
+
parallel (1.12.1)
|
15
|
+
parser (2.5.1.2)
|
16
|
+
ast (~> 2.4.0)
|
17
|
+
powerpack (0.1.2)
|
18
|
+
rainbow (3.0.0)
|
19
|
+
rake (10.5.0)
|
20
|
+
rspec (3.8.0)
|
21
|
+
rspec-core (~> 3.8.0)
|
22
|
+
rspec-expectations (~> 3.8.0)
|
23
|
+
rspec-mocks (~> 3.8.0)
|
24
|
+
rspec-core (3.8.0)
|
25
|
+
rspec-support (~> 3.8.0)
|
26
|
+
rspec-expectations (3.8.2)
|
27
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
+
rspec-support (~> 3.8.0)
|
29
|
+
rspec-mocks (3.8.0)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.8.0)
|
32
|
+
rspec-support (3.8.0)
|
33
|
+
rubocop (0.59.2)
|
34
|
+
jaro_winkler (~> 1.5.1)
|
35
|
+
parallel (~> 1.10)
|
36
|
+
parser (>= 2.5, != 2.5.1.1)
|
37
|
+
powerpack (~> 0.1)
|
38
|
+
rainbow (>= 2.2.2, < 4.0)
|
39
|
+
ruby-progressbar (~> 1.7)
|
40
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
41
|
+
ruby-progressbar (1.10.0)
|
42
|
+
unicode-display_width (1.4.0)
|
43
|
+
|
44
|
+
PLATFORMS
|
45
|
+
ruby
|
46
|
+
|
47
|
+
DEPENDENCIES
|
48
|
+
bundler (~> 1.16)
|
49
|
+
cancancan_masquerade!
|
50
|
+
rake (~> 10.0)
|
51
|
+
rspec (~> 3.0)
|
52
|
+
rubocop (~> 0.59)
|
53
|
+
|
54
|
+
BUNDLED WITH
|
55
|
+
1.16.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Chris Hall
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
# CanCanCan::Masquerade
|
2
|
+
|
3
|
+
Put on a mask and pretend! CanCanCan::Masquerade allows your objects to pretend
|
4
|
+
to be other objects when checking permissions.
|
5
|
+
|
6
|
+
This gem was originally designed with the goal of allowing ViewModels to act as
|
7
|
+
Models in a Ruby on Rails application. The implementation is simple enough that
|
8
|
+
it can be applied to pretty much any object you like.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'cancancan_masquerade'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install cancancan_masquerade
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
Include Masquerade in your ability class!
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
class Ability
|
32
|
+
include CanCan::Ability
|
33
|
+
include CanCanCan::Masquerade
|
34
|
+
|
35
|
+
# ... your permissions, as usual
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
From here, we're operating on other objects in your project. Only that one
|
40
|
+
modification needs to be made to your ability class for this to work.
|
41
|
+
|
42
|
+
### Inheriting from an instance variable
|
43
|
+
|
44
|
+
If the object you'd like to masquerade as is an instance variable of the current
|
45
|
+
object, simply specify it as a symbol (similar to delegating to an instance
|
46
|
+
variable in Rails):
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
class MaskedDancer
|
50
|
+
extend CanCanCan::Masquerade::InheritPermissions
|
51
|
+
|
52
|
+
inherit_permissions_from :@dancer
|
53
|
+
|
54
|
+
# ... rest of your class
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
### Inheriting from a method
|
59
|
+
|
60
|
+
If the object you'd like to masquerade as can be accessed via a property of the
|
61
|
+
current object, pass the name of the method as a symbol:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
class MaskedDancer
|
65
|
+
extend CanCanCan::Masquerade::InheritPermissions
|
66
|
+
|
67
|
+
inherit_permissions_from :partner
|
68
|
+
|
69
|
+
# ... rest of your class
|
70
|
+
end
|
71
|
+
```
|
72
|
+
|
73
|
+
### Inheriting by building another object
|
74
|
+
|
75
|
+
If neither of the above work and the current object can be mapped into the object
|
76
|
+
you wish to pretend to be, you can specify the class name and the mapping directly:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
class MaskedDancer
|
80
|
+
extend CanCanCan::Masquerade::InheritPermissions
|
81
|
+
|
82
|
+
inherit_permissions_from Dancer,
|
83
|
+
mapping: { name: :@name,
|
84
|
+
type: :type
|
85
|
+
}
|
86
|
+
|
87
|
+
# ... rest of your class
|
88
|
+
end
|
89
|
+
```
|
90
|
+
|
91
|
+
_The mapping must be a hash!_ Values that are symbols will be checked against
|
92
|
+
defined methods and instance variables for mapping. If neither match or the
|
93
|
+
value is not a symbol, it will be passed as is.
|
94
|
+
|
95
|
+
### Complex build process
|
96
|
+
|
97
|
+
If the new object can't be built using one of these methods, you can pass a block
|
98
|
+
that will be called when the object is needed for checking permissions:
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
class MaskedDancer
|
102
|
+
extend CanCanCan::Masquerade::InheritPermissions
|
103
|
+
|
104
|
+
build_permission_instance do
|
105
|
+
# build your permission object here
|
106
|
+
end
|
107
|
+
end
|
108
|
+
```
|
109
|
+
|
110
|
+
## Development
|
111
|
+
|
112
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
113
|
+
`rake spec` to run the tests. You can also run `bin/console` for an interactive
|
114
|
+
prompt that will allow you to experiment.
|
115
|
+
|
116
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
117
|
+
release a new version, update the version number in `version.rb`, and then run
|
118
|
+
`bundle exec rake release`, which will create a git tag for the version, push git
|
119
|
+
commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
120
|
+
|
121
|
+
## Contributing
|
122
|
+
|
123
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/chall8908/cancancan_masquerade.
|
124
|
+
This project is intended to be a safe, welcoming space for collaboration, and
|
125
|
+
contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org)
|
126
|
+
code of conduct.
|
127
|
+
|
128
|
+
## License
|
129
|
+
|
130
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
131
|
+
|
132
|
+
## Code of Conduct
|
133
|
+
|
134
|
+
Everyone interacting in the CancancanMasquerade project’s codebases, issue trackers,
|
135
|
+
chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/cancancan_masquerade/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "cancancan_masquerade"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/setup
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "cancancan/masquerade/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "cancancan_masquerade"
|
7
|
+
spec.version = CanCanCan::Masquerade::VERSION
|
8
|
+
spec.authors = ["Chris Hall"]
|
9
|
+
spec.email = ["chall8908@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{ Allow your objects to masquerade as other objects when checking permissions }
|
12
|
+
spec.description = <<-DESC
|
13
|
+
Put on a mask and pretend! CanCanCan::Masquerade allows
|
14
|
+
your objects to pretend to be other objects when checking
|
15
|
+
permissions.
|
16
|
+
DESC
|
17
|
+
spec.homepage = "https://github.com/chall8908/cancancan_masquerade"
|
18
|
+
spec.license = "MIT"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_dependency 'cancancan', '~> 2.1'
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
34
|
+
spec.add_development_dependency 'rubocop', '~> 0.59'
|
35
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module CanCanCan
|
2
|
+
module Masquerade
|
3
|
+
|
4
|
+
# Override functionality from CanCan to allow objects to masquerade as other objects
|
5
|
+
def extract_subjects(subject)
|
6
|
+
return extract_subjects(subject.to_permission_instance) if subject.respond_to? :to_permission_instance
|
7
|
+
|
8
|
+
return subject[:any] if subject.is_a? Hash and subject.key? :any
|
9
|
+
|
10
|
+
[subject]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'cancancan/masquerade/inherit_permissions'
|
16
|
+
require 'cancancan/masquerade/version'
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module CanCanCan
|
2
|
+
module Masquerade
|
3
|
+
module InheritPermissions
|
4
|
+
|
5
|
+
protected
|
6
|
+
|
7
|
+
def inherit_permissions_from record, mapping: nil
|
8
|
+
|
9
|
+
case record
|
10
|
+
when /^@/ then permissions_from_instance_variable(record)
|
11
|
+
when Symbol then permissions_from_method(record)
|
12
|
+
when Class then permissions_from_constructed_class(record, mapping)
|
13
|
+
else
|
14
|
+
raise InvalidPermissionConfiguration, "Invalid record type: #{record.class}. Expecting Symbol or Class."
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def build_permission_instance &block
|
19
|
+
define_method(:to_permission_instance, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def permissions_from_instance_variable(variable)
|
25
|
+
build_permission_instance { instance_variable_get(variable) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def permissions_from_method(method)
|
29
|
+
build_permission_instance { send(method) }
|
30
|
+
end
|
31
|
+
|
32
|
+
def permissions_from_constructed_class(class_to_build, mapping)
|
33
|
+
unless mapping.is_a?(Hash)
|
34
|
+
raise InvalidPermissionConfiguration, "Must supply a `mapping:` when building from a Class"
|
35
|
+
end
|
36
|
+
|
37
|
+
build_permission_instance do
|
38
|
+
values = mapping.reduce({}) do |final, (key, value)|
|
39
|
+
mapped_value = if value.is_a? Symbol and respond_to? value
|
40
|
+
send value
|
41
|
+
elsif value.is_a? Symbol and instance_variable_defined? value
|
42
|
+
instance_variable_get value
|
43
|
+
else
|
44
|
+
value
|
45
|
+
end
|
46
|
+
|
47
|
+
final.merge(key => mapped_value)
|
48
|
+
end
|
49
|
+
|
50
|
+
class_to_build.new(values)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class InvalidPermissionConfiguration < StandardError; end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cancancan/masquerade'
|
metadata
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cancancan_masquerade
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Hall
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cancancan
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.16'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.59'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.59'
|
83
|
+
description: |2
|
84
|
+
Put on a mask and pretend! CanCanCan::Masquerade allows
|
85
|
+
your objects to pretend to be other objects when checking
|
86
|
+
permissions.
|
87
|
+
email:
|
88
|
+
- chall8908@gmail.com
|
89
|
+
executables: []
|
90
|
+
extensions: []
|
91
|
+
extra_rdoc_files: []
|
92
|
+
files:
|
93
|
+
- ".gitignore"
|
94
|
+
- ".rspec"
|
95
|
+
- ".travis.yml"
|
96
|
+
- CODE_OF_CONDUCT.md
|
97
|
+
- Gemfile
|
98
|
+
- Gemfile.lock
|
99
|
+
- LICENSE.txt
|
100
|
+
- README.md
|
101
|
+
- Rakefile
|
102
|
+
- bin/console
|
103
|
+
- bin/rspec
|
104
|
+
- bin/setup
|
105
|
+
- cancancan_masquerade.gemspec
|
106
|
+
- lib/cancancan/masquerade.rb
|
107
|
+
- lib/cancancan/masquerade/inherit_permissions.rb
|
108
|
+
- lib/cancancan/masquerade/version.rb
|
109
|
+
- lib/cancancan_masquerade.rb
|
110
|
+
homepage: https://github.com/chall8908/cancancan_masquerade
|
111
|
+
licenses:
|
112
|
+
- MIT
|
113
|
+
metadata: {}
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
requirements: []
|
129
|
+
rubyforge_project:
|
130
|
+
rubygems_version: 2.7.7
|
131
|
+
signing_key:
|
132
|
+
specification_version: 4
|
133
|
+
summary: Allow your objects to masquerade as other objects when checking permissions
|
134
|
+
test_files: []
|