I must say, I really like Hobo's new permission system.  That said, I don't
find the following very readable...

def update_permitted?
  return false unless owner_is? acting_user
  none_changed? :address, :city, :zipcode
end


It also gets unwieldy if you're passing lots of fields to none_changed.

What about putting the permissions into the field declaration itself?

fields do
  address :string, :except => :update
  city :string,    :except => :update
  zipcode :string, :except => :update
end

def update_permitted?
  owner_is? acting_user
end

This would be totally optional -- the restrictions would be in addition to
those imposed with the current permission system.


You could have some helpers to make it even more readable:

fields do
  name :string,   :read_only
  avatar :string, :owner_only
  pingid :string, :only => [:create, :destroy]
  perm :string,   :except => :delete
end

Does this make sense?  It seems like it would help dry out my models quite a
bit.

   - Scott

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to