Limiting who and see/update which record

Hello, all,

Say I own a freelance article editing company that help my clients
editing their articles to a certain standard. And my employees are
editors. a Article Model, an Assignment Model, and then an Editor
Model. Most of the time one article is edited by one Editor ( and this
arrangement is called an Assignment). Sometimes, things get rushy and
we put a few editors for one article.

so I guess I will have a many Editors to many Articles relationship by
using the Has_many :through => :assignments

class Editor < ActiveRecord::Base
has_many :assignments
has_many :articles, :through => :assignments
end

class Assignment < ActiveRecord::Base
belongs_to :article
belongs_to :editor
end

class Article < ActiveRecord::Base
has_many :assignments
has_many :editors, :through => :assignments
end

If I want only relevant editor(s) to see an article–relevant being
defined as the editor(s) is assigned to that very artcile–and also to
update that artcile, as needed for editing it, where would one put
such a mechanism (ApplicationController / Model / elsewhere)? And how
would such a mechanism work?

[email protected]

Nik wrote:
[…]

If I want only relevant editor(s) to see an article–relevant being
defined as the editor(s) is assigned to that very artcile–and also to
update that artcile, as needed for editing it, where would one put
such a mechanism (ApplicationController / Model / elsewhere)? And how
would such a mechanism work?

You might want to take a look at the rails_authorization plugin.

[email protected]

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Thanks Marnen, I will check it out.

On Aug 11, 9:04 pm, Marnen Laibow-Koser <rails-mailing-l…@andreas-

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs