Not sure if this is a bug, intentional, or an error on my installation.
When a user only has permission to view tasks of their organization they can still drag to re-order the tasks and save the changes.
It's not so much that I don't want my users re-ordering I just think it may add confusion. And this generally seems like an inconsistency in permissions.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | stormtask.admin_.inc_.patch | 546 bytes | Magnity |
| #7 | stormtask_527870_admin_inc.patch | 1.36 KB | Magnity |
| #7 | stormtask_527870_theme_inc.patch | 1.27 KB | Magnity |
Comments
Comment #1
otakikam commentedComment #2
homoludens commentedI agree with otakikam, and will look into this. Users should have as simple interface as possible.
Comment #3
Magnity commentedNot regarding the simplicity issue - it is a bit inconsistent with the permissions, and there are several other places in Storm that happens which could do with fixing.
Would it be as simple as an
if (edit permission) { click and drag function } else { standard table }?Comment #4
homoludens commentedShould be something like that:
In function theme_stormtask_tasks (in stormtask.theme.inc) only this line is important to make rows draggable:
and in function stormtask_tasks_form (in stormtask.admin.inc) omitting this code will prevent user form saving.
but that is only template side, there is more work to make it really secure. This two changes should fix presentation side but I searching how to really prevent (even malicious) users from modifying list.
Would it be enough to add check for permissions in function stormtask_tasks_submit (in stormtask.admin.inc) or it is enough not to show $form['submit'] ?
Comment #5
Mark_Watson27 commentedPersonally, I'd do both, i.e. add permission check for display and submit just to make sure.
Comment #6
Magnity commentedJust to add an extra question - say a user has the permission 'edit own', how should this be handled for this purpose?
---
I'd like to solve this issue before the release of 6.x-1.24.
(See #540212: Testing of -dev version before 6.x-1.24 release)
Comment #7
Magnity commentedThe issue that I mentioned previously relates to that if a user does not have a simple edit permission, it may be that the user is supposed to be allowed to be edit some nodes that are listed and not others. Therefore, in the attached patches, I have simply used the user_access('stormtask: edit all') rather than stormtask_user_access().
However - it does seem to be a bit of a hack method, which I don't like all that much (small changes all over the place).
Comment #8
Magnity commentedDid anyone have any more thoughts on this one?
Comment #9
Mark_Watson27 commentedAs this only applies to a projects task, can we check permissions on the project instead of all tasks, i.e. if they're allowed to edit the project then they're allowed to re-order the tasks?
Comment #10
Magnity commentedSounds like it might be better.
In terms of the node and where the data is stored - we'd be bypassing the permissions by changing the weight and/or parent task fields when the user may not have permission to, but conceptually I guess those fields only have a relevance when seen together on the project.
Comment #11
Magnity commentedVery pleased to say that this one has been fixed, should have got this in ages ago.
Committed to both D6 and D7. Dev within 12 hours.
Its not the neatest possible unfortunately, checks for
stormproject_access('update', $project->nid)a fair bit.Comment #13
ñull commentedI gave a user all the task permissions. Theoretically it should allow him to reorder but it doesn't (was reported here ). There are also two extra empty and therefore useless column headers now.
Comment #14
Magnity commentedAs stated in #677830: Ajax crossed arrow icons missing in hierarchical task view and above, this has been applied so that if you can edit the project of the tasks, you can reorder the tasks for that project using the ajax 'clickndrag'.
There should not be empty column headers appearing. I will check this, but I seem to remember putting the access checks on them as well so that they would not appear if the user did not have permission to reorder the tasks.
Comment #15
Magnity commentedI've just checked to see whether empty column headers appear on the demo site, with users with all then limited permissions.
All appeared correctly.
Comment #16
ñull commentedThat the user could not re-order had to do with the project permission (they apparently come into play too). With no project permissions set, no re-ordering is possible and the two empty columns don't appear either, but I can give an exact permission combination that will make the columns appear and I don't understand really why it should be prohibited to re-order:
That is for a project where the user:
The tasks in the list were both created by the user and the user was assigned to them.
Can you reproduce that on your test system?
Comment #17
Magnity commentedOK - I see the additional columns there - will have a look at why its happening.
Comment #18
Magnity commentedOK - does this patch solve the issue?
Comment #19
ñull commentedYes, user with the indicated permission does not see the empty columns any more and can now reorder through Ajax. Thanks!
Comment #20
Magnity commentedCommitted. Thanks.