Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sketching out ideas discussion for after RC and release
- Loading branch information
1 parent
a9e3e60
commit 0ab8b54
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## Role Filters | ||
|
||
In this case, disregard any permits relating to the :bloggers role | ||
```ruby | ||
user_can? :roles_filter => :bloggers | ||
``` | ||
|
||
Config: | ||
|
||
```ruby | ||
CanTango.config.roles.filter :on | ||
CanTango.config.roles.filter :off | ||
``` | ||
|
||
Will use: | ||
|
||
```ruby | ||
CanTango.config.roles.register :admin | ||
|
||
CanTango.config.roles.registered | ||
CanTango.config.roles.registered | ||
``` | ||
|
||
We should also have a #tango_role macro to add on the role class, which | ||
will lazily execute Role.all somehow. | ||
|
||
This should later be extended with: | ||
|
||
```ruby | ||
CanTango.config.roles.included :admin... | ||
``` | ||
|
||
In Ability#initialize | ||
|
||
```ruby | ||
with(:permits) {|permit| break if permit.execute == :break } | ||
... | ||
``` | ||
|
||
Becomes | ||
|
||
```ruby | ||
with(:filtered_permits) {|permit| break if permit.execute == :break } | ||
... | ||
``` | ||
|
||
## Domain differentiation | ||
|
||
Load specific permissions file (or permits) depending on which domain the user is in. | ||
Would be nice to allow user to hook in and customize load logic in some | ||
way. Have Session and Request obj available. | ||
|
||
Also need some more documentation and specs on the use of special | ||
permits Any and System. Any is last permit to always exectute (unless | ||
flow broken). System is always first permit and can break off the flow, thus no | ||
other permits may have effect after if broken. | ||
|
||
Is there a need to enhance this with more control flow? Keep it simple! |