#692 ✓resolved
Henry Baragar

<sortable-collection> does not check edit permissions on the position

Reported by Henry Baragar | April 8th, 2010 @ 04:54 AM

I have an application where there is a group of users that is allowed to change fields other than the "position" field in a "act_as_list" model. That is, when they are presented with a they should not see the arrows for rearranging the order of the records.

I think that the following line in :

<div class='ordering-handle' param='handle' if='&can_edit?'>&uarr;<br/>&darr;</div>
should be changed to:
<div class='ordering-handle' param='handle' if='&can_edit? :position'>&uarr;<br/>&darr;</div>
or maybe to:
<div class='ordering-handle' param='handle' if='&can_edit? position_field'>&uarr;<br/>&darr;</div>
where "position_field" is defined as:
position_field = (attributes[:position] || 'position').to_symbol
so that a different 'position' field can be specified.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Tags

Referenced by

Pages