Hi Sean Unfortunately the link to the forum is broken.
The way it seems from your code is that you use the logged_in method to determine whether a field should be viewable or not. I am trying to do this on a record level, so this is something I expect to happen in the controller or ideally from within the permission system. But I would be happy to know where to place the controller code roland Am 12.12.2008 um 18:25 schrieb Hobo_Fan: > > Hi rolando , > > I found a good write out written by larryk on hobocentral in regards > of viewable_by? and updateable_by? methods. You might want to take a > look. > > http://hobocentral.net/forum/viewtopic.php?p=5108&sid=eca9b87ea696a742b90510a1c1e888eb > > Unfortunately, I was not able to understand it and do not how to > implement it with my app. > > But I was able to allow user who logged in to see certain fields, for > example: > > <aside:> > <h2>Licensing Info</h2> > <% for license in @product.licenses %> > <ul> > <li> > License Key: <%= license.key if logged_in? %> > <br/>Client: <%= h(license.client.last_name) if ! > license.client.nil? %> > </li> > </ul> > <% end %> > <br/> > <p><a to="&License" action="new">Add New License</a></p> > </aside:> > > Let me know if you figure out how to use the viewable_by method. > > Thanks, > Sean > > On Dec 12, 2:15 am, solars <[email protected]> wrote: >> On Fri, Dec 12, 2008 at 10:09:14AM +0000, James Garlick wrote: >> >>> I think you'd be better off constraining the collection in the >>> controller based on the status of the user rather than using the >>> permission system. Otherwise you'll be retrieving a whole load of >>> unnecessary data from the database which isn't very efficient. >> >> Yeah that would be smarter anyway, I guess that's the reason Tom >> only included the can_view? check in the (default) collection tag. > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
