rolify 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -4
- data/lib/rolify/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -4,7 +4,7 @@ Very simple Roles library without any authorization enforcement supporting scope
|
|
4
4
|
|
5
5
|
Let's see an example:
|
6
6
|
|
7
|
-
user.
|
7
|
+
user.has_role?("moderator", Forum.first)
|
8
8
|
=> false # if user is moderator of another Forum
|
9
9
|
|
10
10
|
This library was intended to be used with CanCan[https://github.com/ryanb/cancan] and devise[https://github.com/plataformatec/devise/] but should be generic enough to be used by any other authentication/authorization solutions.
|
@@ -66,9 +66,9 @@ To check if a user has a global role
|
|
66
66
|
To check if a user has a role scoped to a resource
|
67
67
|
|
68
68
|
user = User.find(2)
|
69
|
-
user.has_role "moderator", Forum.first
|
69
|
+
user.has_role? "moderator", Forum.first
|
70
70
|
=> true
|
71
|
-
user.has_role "moderator", Forum.last
|
71
|
+
user.has_role? "moderator", Forum.last
|
72
72
|
=> false
|
73
73
|
|
74
74
|
== Questions or Problems?
|
@@ -77,4 +77,7 @@ If you have any issues with rolify which you cannot find the solution to in the
|
|
77
77
|
|
78
78
|
== TODO
|
79
79
|
|
80
|
-
* put syntactic sugar
|
80
|
+
* put syntactic sugar:
|
81
|
+
* +is_admin?+ like shortcuts
|
82
|
+
* multiple role names query at the same time
|
83
|
+
* write a tutorial showing how to use rolify with CanCan and devise
|
data/lib/rolify/version.rb
CHANGED