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

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -