ruby on rails 4 - Authorization for different users on active_admin -



ruby on rails 4 - Authorization for different users on active_admin -

if have many models different users manage them.

user responsible car, order, ship

user b responsible plane, order

every user should modify models resposible for.

how on active_admin ?

any articles refer ?

thanks

cancan authorization library ruby on rails restricts resources given user allowed access. permissions defined in single location (the ability class) , not duplicated across controllers, views, , database queries.

https://github.com/cancancommunity/cancancan

and need role manager: https://github.com/rolifycommunity/rolify

so can write in ability.rb:

if current_admin_user.has_role? :rolea can :manage car, order, ship elsif current_admin_user.has_role? :roleb can :manage, plane, order end

ruby-on-rails-4 activeadmin

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -