Have a look at [1]: has_static_permission? accesses
"static_permissions" which is a method which itself collects all
permissions of all roles. True, this could directly be done in the
database but as long as nobody complains about active-rbac being slow,
I will keep the simpler code :)
*m
[1] http://active-rbac.rubyforge.org/svn/active-rbac/trunk/plugin/lib/active_rbac/acts_as_user.rb
> to have more fine grained control without ending up creating lots of
> groups.
Yes, this is the case. The idea of a Role Based Access System is that
permissions are granted based on roles. This removes complexity but of
course also some power.
However, you could always do something like this:
1 Role roles.user
2 StaticPermission permissions.user_can_edit_own_articles
3 assign 2 to 1
Then, in your code do something like:
if "user owns article" and user.has_permission?
("permissions.user_can_edit_own_articles") then ...
Bests,
Manuel
>
> thank you manuel!
>
> another short question which i found no answer to: is there any
> practical
> reason in prefixing the identifiers with "roles." and "permissions."?
Not really, it is just my private convention.