Hi all,

I'm trying to convert the view of a custom index_action to a table.
It's not working because of complicated view_permissions.

It's strange because:
(1) it works without Table-Plus just fine:
        history.dryml: <index-page/>

              versus

        history.dryml:
<index-page>
    <main-nav: current="history" />
    <collection: replace>
        <div>
            <table-plus fields="this,other_var">
            </table-plus>
        </div>
    </collection>
</index-page>

(2) it works with Table-Plus when you're the administrator
(3) The "thing" counter on the page (even with Table-Plus) shows the
right about of entries - I think the scope is capturing the right ones
(4) The permissions work perfectly on the show-pages too

I'm thinking it must be something to do with Table-Plus and the View-
Permitted not getting along.  The records just do not show up, it is
not empty (I've checked with an empty message).

The only other person I can find talking about this is here:
http://groups.google.com/group/hobousers/browse_thread/thread/aba4a97ca2bb99d9/defe9568439adc5d?lnk=gst&q=table+permission#defe9568439adc5d

How could I modify history.dryml to do a check if view_permitted?  Any
other ideas??  I'm really lost.

Mike


Thing controller:
  index_action :history

  def history
    hobo_index (Thing.owner_id_is(current_user.id))
  end

I have also tried current_user.things for the scope.

Thing model:
  def view_permitted?(field)
    return true if (owner_is?(acting_user))
    return true if (acting_user.administrator?)
    return true if (other_condition?)
    return true if (other_condition2?)
    return false

  end

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