Thanks for your help Vivek, but that's not my problem,
The 'signed_up?' check is purely so I can give a friendly message to those 
who aren't logged in.  
It's the <show-index> that is the problem.  It returns blank unless I use 
'with' - but I have a defined model that is for that purpose - the 'with' 
is breaking my model, I just don't need it in theory, but I can't get it to 
work without it...

this is my view model...

  def view_permitted?(field)
    acting_user.administrator? || (acting_user.signed_up? && 
user_is?(acting_user))
  end


Anthony.


On Wednesday, October 31, 2012 4:46:01 PM UTC, tonym wrote:
>
> This one's baffled me - just can't figure out why show-index needs 
> 'with="&current_user"?
> I first came across this in the agility tutorial, found a fix here and 
> thought nothing of it.  But with my project, it's become a problem...
> I have all my permissions sorted in my model - admin can view all records, 
> standard users view only the records they've created.
> The permissions worked fine, the views return the right records, until I 
> customized the page through <show-index>
>
> <show-index> always returns blank, unless I use the 'with="&current_user" 
>  (that's the fix, discuss here in another thread).
> But if I use the 'with', then the admin can only view their own records, 
> thus breaking my model...  Can I get the index page up without using 
> 'with', and use the rules in my model?  
>
> Here's my view code...
>
> <if test="&current_user.signed_up?">
>   <index-page with="&current_user">
>    <top-page-nav: replace /> 
>    <bottom-page-nav: replace /> 
>     <collection: replace>
>       <table-plus:my_venues fields="name, venuetype, local_area, 
> telephone, approval" />
>     </collection:>
>   </index-page>
> </if>
> <else>
>   <page title="No Access">
>   </page>
> </else>
> Thanks, Anthony.
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/3HkU0sMNHyAJ.
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