rails-canhaz 0.1.1 → 0.1.2
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.
- data/README.md +6 -0
- data/rails-canhaz.gemspec +5 -3
- metadata +19 -4
data/README.md
CHANGED
@@ -63,12 +63,18 @@ article = Article.find(1337)
|
|
63
63
|
user.can?(:read, article) # Can the user read this article? false for now
|
64
64
|
|
65
65
|
user.can(:read, article) # Ok, so the user can read this article
|
66
|
+
user.can(:edit, article) # He can edit it as well
|
66
67
|
|
67
68
|
user.can?(:read, article) # Will be true
|
68
69
|
|
69
70
|
user.objects_with_permission(Article, :read) # Will return all the articles w/ read permissions for this user
|
70
71
|
|
71
72
|
artice.subjects_with_permission(User, :read) # Will return all the users hat are able to read this article
|
73
|
+
|
74
|
+
#You can also remove permissions
|
75
|
+
|
76
|
+
user.cannot(:read, article)
|
77
|
+
|
72
78
|
```
|
73
79
|
|
74
80
|
More coming soon ...
|
data/rails-canhaz.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'rails-canhaz'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.2'
|
4
4
|
s.date = '2012-04-16'
|
5
5
|
s.summary = "A simple gem for managing permissions between rails models"
|
6
6
|
s.description = "A simple gem for managing permissions between rails models"
|
@@ -8,6 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.email = 'adrien@siami.fr'
|
9
9
|
s.files = `git ls-files`.split("\n")
|
10
10
|
|
11
|
-
s.homepage =
|
12
|
-
|
11
|
+
s.homepage = 'http://github.com/Intrepidd/rails-canhaz'
|
12
|
+
|
13
|
+
s.add_dependency 'activerecord', '>= 3.1.0'
|
14
|
+
|
13
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-canhaz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,23 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-04-16 00:00:00.000000000 Z
|
13
|
-
dependencies:
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activerecord
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.1.0
|
14
30
|
description: A simple gem for managing permissions between rails models
|
15
31
|
email: adrien@siami.fr
|
16
32
|
executables: []
|
@@ -56,9 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
72
|
version: '0'
|
57
73
|
requirements: []
|
58
74
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.8.
|
75
|
+
rubygems_version: 1.8.23
|
60
76
|
signing_key:
|
61
77
|
specification_version: 3
|
62
78
|
summary: A simple gem for managing permissions between rails models
|
63
79
|
test_files: []
|
64
|
-
has_rdoc:
|