hi toby,

you can change the view_permitted? method of the user model so that it
reads the role of the current user and determines whether he is
allowed to see this field:

def view_permitted?(field)
    if (field.to_s == "address")
      # admins should see this field
      return true if acting_user.administrator?
      # no one except owner should see this field
      return false if self != acting_user
    end

bye,
Peter

On 5 Feb., 15:17, slioch999 <[email protected]> wrote:
> In the User model I have various additional fields for the user (e.g.
> name, address etc and also role).
>
> The page for every user is visible, but I am trying to design it so
> that the fields displayed for that user are determined by the role
> that person has.
>
> How is the best way to do this? In the model, in the DRYML?
>
> Thanks
>
> Toby [Beginner]

-- 
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