On Wed, Nov 11, 2009 at 3:10 AM, Sergio Cambra .:: entreCables S.L.
::. <[email protected]> wrote:
> On Miércoles, 11 de Noviembre de 2009 02:02:59 Aaron Turner escribió:
>> FYI, further testing shows it isn't because I'm overriding the column
>> values in the WinesHelper.
>
> Maybe I haven't understood you. I thought you get no rows in the list. Do you
> get some rows but cells are empty?

Sorry.  Yes, I get the rows, but some of the cells are empty.

>>
>> Maybe it still is because the default action is edit though... I still
>> haven't been able to figure out a cleaner way over overriding the
>> method generated for joined tables.  It sorta makes sense, although I
>> would of expected the table to be generated normally and only getting
>> a forbidden error via lockdown when trying to click the edit action
>> link.
>
> ActiveScaffold checks permission to make a link to edit or show, but it checks
> permission using authorized_for_update?, column_authorized_for_update? and
> column_authorized? methods in the model. I don't know if lockdown adds some
> methods like that. But a value is always shown with a link to show.

I'll have to research if it does that.  So far I know it applies
permissions at the controller level and

> Also, you can remove the link in the column with
> config.columns[:column_name].clear_link. It should remove problems related to
> permissions.

That + the helpers thing does the trick.  Clearly something is fubar
with the authorized methods AS is using... I'll try to dig what, but
at least things are working.  Thanks!

>
> You can get empty cells when authorized_for_read?, column_authorized_for_read?
> or column_authorized? returns false for that record.
>
> You can try it in script/console, loading the record and checking
> authorized_for?(:action => :read, :column => :column_name):
>
> record = Wine.find(id)
> record.authorized_for?(:action => :read, :column => :varietal)

Thanks for the hints.

-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

--

You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=.


Reply via email to