i created a Devise with CanCan integration like told on:
http://starqle.com/articles/rails-3-authentication-and-authorization-with-devise-and-cancan-part-1/
http://starqle.com/articles/rails-3-authentication-and-authorization-with-devise-and-cancan-part-2/
now i have two resources for my User class. Devise and a RESTful resources :users.
as mentioned in the tutorial, i included in the RESTful edit_user_path a form for editing the rights for the user.
now i don't understand how i can restrict normal users to access that edit function and use devise edit function for that.
Is it possible to just restrict a user to
can :manage, User
but he still can manage devise controller?
Solved
Just can add an in ability.rb
can :assign_roles, User
and then in _form for RESTful edit
<% if can? :assign_roles, current_user %>
and then let Users edit either over RESTful _form or Devise form, doesn't matter then
Edit
_form.html.erb (or haml)
<% if can? :assign_roles, @user %>
may work too. depends on your controller. should work better since i have made a bit workaround to fit it to current_user