Search code examples
ruby-on-railsruby-on-rails-3rolesuser-roles

how can i assign each user to have access to the projects on different condition?


I have devise for authentication and i have to make specific users to have only view permission for that particular projects and create and read permission for the same user for different projects similarly the rest of the users should have permissions for projects. And this permission should be editable so that the user with role admin has to edit the permission for the users. How can i do this?


Solution

  • Ryan Bates' CanCan gem would answer most of your requirements. Check out the RailsCast episode on CanCan for a quick intro: http://railscasts.com/episodes/192-authorization-with-cancan

    Not sure if it - off the shelf - provide for graphically editing the permissions, but I think it could be implemented with the available functionality in CanCan.