[ckan-dev] Overriding validation
Ian Ward
ian at excess.org
Wed Feb 3 13:11:09 UTC 2016
You can override the validation on a dataset field with a custom
IDatasetForm pluginhttp://
docs.ckan.org/en/latest/extensions/adding-custom-fields.html?highlight=idatasetform
or by using ckanext-scheming.
You'll have to override the package_show auth check to allow the user that
created a private dataset to see it with an IAuthFunctions plugin.
You'll have to adjust the dataset form to display the private field,
because it's hidden when no orgs are selected.
Your next problem will be that private datasets only appear in organization
search pages. You'll need to adjust the search or create some other way to
find these private datasets.
Ian
On Tue, Feb 2, 2016 at 5:17 PM, Mariano Falcon <mf2286 at gmail.com> wrote:
> Hello fellow members!
>
> I'm building a custom site and I'd like to allow the possibility for the
> users to create private datasets without belonging to an organization.
>
> There's a validator called
> "datasets_with_no_organization_cannot_be_private" that I'd like to override
> or just ignore, but I don't know the correct and clean way to solve this.
>
> To temporally solve it I flagged the check_passed variable to True, to
> bypass the controls, but I'd like to find a way to solve this problem
> without touching core code.
>
> Any ideas?.
>
> Thanks for your help.
>
> --
> Mariano Falcón
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160203/e1d564d8/attachment-0003.html>
More information about the ckan-dev
mailing list