kant 0.0.2 → 0.0.3

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: 8aeeefb188062978e189623f81d217b7988ed158
4
- data.tar.gz: b658a15f162e5a88a2f576394ae12398102084aa
3
+ metadata.gz: d0b65ae77365d3fb81725cb1dad2634d25b51640
4
+ data.tar.gz: dac368c947e0ab658ce42dbc0570214d218dbec5
5
5
  SHA512:
6
- metadata.gz: c034e6d3971a058076c5eed08aefad7adc4620d51a09e59dc790c19bcff21cfc0762b70d8fbbc2b8f769722df251714684a9fd3ebcf6f174fc2cbcbe5de5d15d
7
- data.tar.gz: d4c6c7e75190b3064383d344900f36ba6d8164ba971b2113af64ddde0365272c7b31ac78155c601afb7a88be3d082e9c5ce525eef2c463bf36d1de00d9654003
6
+ metadata.gz: 4a6684cc5fbbe9d9a90a8b14aa7c32b75dfc112eac379630c383646679f9cf0588e932057ad0eb585a2ea6ec7108287342cf73ca458aacad83cc8d82d3338628
7
+ data.tar.gz: bd2b8391077f3f7ec7b13b03375bf6e4310fe9f57ff3dc957a9be82785cfc2f786a575f35f216eefc0c27a61a3372496d9d2dfa728b063ed911cff30e8362caa
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Kant v0.0.2
1
+ # Kant v0.0.3
2
2
 
3
3
  Kant is a tiny authorization library for your Ruby (especially Rails and/or
4
4
  ActiveRecord) projects.
@@ -1,6 +1,9 @@
1
1
  module Kant
2
2
  class AllAccess
3
+ attr_reader :user
4
+
3
5
  def initialize(user)
6
+ @user = user
4
7
  end
5
8
 
6
9
  def can?(action, object)
@@ -1,6 +1,9 @@
1
1
  module Kant
2
2
  class NoAccess
3
+ attr_reader :user
4
+
3
5
  def initialize(user)
6
+ @user = user
4
7
  end
5
8
 
6
9
  def can?(action, object)
data/lib/kant/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kant
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -17,4 +17,8 @@ describe Kant::AllAccess do
17
17
 
18
18
  expect(all_access.accessible(:foo, scope)).to eq(scope)
19
19
  end
20
+
21
+ it "has a #user method" do
22
+ expect(all_access.user).to eq(user)
23
+ end
20
24
  end
@@ -18,4 +18,8 @@ describe Kant::NoAccess do
18
18
 
19
19
  expect(no_access.accessible(:foo, scope)).to eq(none)
20
20
  end
21
+
22
+ it "has a #user method" do
23
+ expect(no_access.user).to eq(user)
24
+ end
21
25
  end
@@ -4,6 +4,12 @@ require 'kant/policy_access'
4
4
  describe Kant::PolicyAccess do
5
5
  setup_models
6
6
 
7
+ it "has a #user method" do
8
+ user = User.create!(email: 'foo@bar.com')
9
+ policy_access = Kant::PolicyAccess.new(user)
10
+ expect(policy_access.user).to eq(user)
11
+ end
12
+
7
13
  describe "#can?" do
8
14
  let(:user) { User.create!(email: 'foo@bar.com') }
9
15
  subject(:policy_access) { Kant::PolicyAccess.new(user) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Przepiora
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-07 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project:
146
- rubygems_version: 2.2.2
146
+ rubygems_version: 2.4.5.1
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: A tiny, non-magical authorization library