try this instead of your second line return true if field.in? ['password','password_confirmation','companyname']
On Mar 8, 2:21 pm, "Mark Jones" <[email protected]> wrote: > Hi Bryan, > > > Not only do you have to set the "owner" field to be viewable, you also > > have to set the "name" field of the linked user to be viewable as > > well. > > > Sometimes permissions are tricky to get right. Let me know if you > > still have problems. > > That does make sense when you say that however this doesn't seem to work as > expected for me.. > > I can get this working by setting "def owner_view_permitted? true end" in the > comment model and setting the whole user model > view_permitted to true. However, If I try to explicitly set the Name value > using _view_permitted this stops working. > > I am using companyname as the 'Name' entry in my Usermodel: > > companyname :string, :required, :name => true > > In permissions of my user model I have: > > def view_permitted?(field) > return true if self == acting_user || acting_user.administrator? || > self.new_record? > return true if (field.to_s == "password" || field.to_s == > "password_confirmation") > #return true > end > > def companyname_view_permitted? > true > end > > Anything obviously wrong?? > > Thanks again > > Mark -- 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.
