[ckan-dev] Issue 334 edit related on /app

Toby Dacre toby.okfn at gmail.com
Mon Feb 18 18:15:54 UTC 2013


Issue 334 from ira https://github.com/okfn/ckan/issues/334 requests that we
can edit resources from the /app url

Whilst this makes sense it is problematic

Currently the edit url looks like /package/XXX/related/edit/YYY where XXX
is the dataset id of the item and YYY is the id of the related item.  This
is useful because although related items are a only attached to a single
dataset and the dataset id may be needed by auth functions involved and is
needed by delete.

So on the /app url we would need to supply the dataset id to get the edit
button (in fact if we passed the dataset id we would indeed get an edit
button) however the snippets assume that we pass the package id (which is
identical for all related items) which works for the dataset related item
pages but not for the /app url.

It seems we have 2 options

1) close the issue as a won't fix - this saves doing any work

2) agree to fix this issue which would need the following

a) add a dataset field to the related table that links back to the dataset
that has the item (an populate it)
b) change the logic functions to update this field
c) use this field in the related snippets for correct results

Additionally it looks like I can delete any related item by using a custom
url by providing a dataset that I can edit even if it is not the correct
one that owns the related item.  This would be easier to fix if we go with
option 2

Which option should we take?  Or any other suggestion as to how to fix this.

cheers
Toby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130218/513e1429/attachment.html>


More information about the ckan-dev mailing list