How to create a basic User Permissions per project association?


How to create a basic User Permissions per project association?



I have public and private projects in my app. I want to assign user to private projects for viewing and posting. What's the right way to do this? I tried with a permissionlist model and associated it to a project. but i got so confused that i couldn't make it.




Tracking visitor stats with Ruby on Rails

1:



Rails Productivity Paradox [closed]
What you need is a has_many :through relationship.
Saving Rails output into a variable
Create a table .
Uninitialized constant problem for Rails routes
permissions.
Rails: problem setting expectations on mock model in RSpec
containing .
How to uninstall Ruby on Rails plugin with migrations easily?
user_id, project_id and permission.
Rails order by in associated model
.


Rails form helpers: how to add an element to a collection?
. your models.
class Permission < ActiveRecord::Base   belongs_to :user   belongs_to :project end  class User < ActiveRecord::Base   has_many :permissions, :dependent => true   has_many :projects, :through => :permissions end  class Project < ActiveRecord::Base   has_many :permissions, :dependent => true   has_many :users, :through => :permissions end 
in the permissions link the project, user and the permission the user has on that project.

. I hope this helps.. Regards.



76 out of 100 based on 76 user ratings 526 reviews

@