-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datastore does not hide private resources in SQL search #652
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logic.auth.update is a mess
Also add a docstring. This schema seems to be a base schema for other package schemas to be based on, and a private helper function of schema.py. It's not used outside of schema.py apart from by some tests that probably should not be using it. The new name hopefully makes it clearer what the purpose of this function is.
I think package_form_schema() was probably deprecated using a code comment before we had the Right Way of deprecating things (using the deprecated decorator).
The package_*() action functions handle fetching package schemas and using them to validate package dicts, no need to also do it in the package controller!
Delete package_create_validate() action function. This function has no docstring and no tests, and duplicates package dict validation code in package_create().
Delete package_update_validate() action function. This function has no docstring and no tests, and duplicates package dict validation code in package_update().
From seanh commit 4c917f5
Replace form_to_db_schema(), form_to_db_schema_options(), form_to_db_schema_api_create(), form_to_db_schema_api_update(), form_to_db_package_schema() with just two schemas: create and update. Then get the tests passing. schema.py: - Delete _base_package_schema() - Delete already deprecated package_form_schema() - Delete form_to_db_package_schema() - Tweak default_create_package_schema() and default_update_package_schema() to get tests passing DefaultDatasetForm: - Delete form_to_db_schema_options() - Delete form_to_db_schema() - Delete form_to_db_schema_api_create() - Delete form_to_db_schema_api_update() - Add create_package_schema(), returns None - Add update_package_schema(), returns None Note that by deleting form_to_db_schema() and form_to_db_schema_options(), _api_create() and _api_update(), we're breaking backwards compatibility with any plugins that were using these. package_create(): - Don't call form_to_db_schema_options() or form_to_db_schema(). - Instead call the package plugin's create_package_schema(), if that doesn't exist or if it returns None then call default_create_package_schema() instead package_update(): - Don't call form_to_db_schema_options() or form_to_db_schema(). - Instead call the package plugin's update_package_schema(), if that doesn't exist or if it returns None then call default_update_package_schema() instead Note that by no longer calling the form_to_db_schema_options() or form_to_db_schema() methods of IDatasetForm plugins, we're breaking backward compatibility with those plugins. Note this makes IDatasetForm less flexible - plugins can return different schemas for creating, updating or showing packages, but they can no longer return different schemas depending on whether we're using the API or web UI, or on other parameters from the Pylons context. test_tag_vocab.py: - Update MockVocabTagsPlugin to work with the new interface Also update some other tests.
ghost
assigned domoritz
Mar 19, 2013
…ema() This makes the name consistent with default_create_package_schema() and default_update_package_schema().
package_show(): Don't call an IDatasetForm plugin's db_to_form_schema_options() or db_to_form_schema() anymore, instead call package_show_schema(), if the plugin doesn't have that method or if it returns None then fall back on ckan.logic.schema.default_package_show_schema(). (Same pattern as for package_create() and package_update()). Delete DefaultDatasetForm's db_to_form_schema_options() and db_to_form_schema(), add show_package_schema() that just returns None, same as create_package_schema() and update_package_schema().
This method is never called
These hacks are no longer needed
Conflicts: ckan/lib/search/index.py
…g-vocabulary-show
This field accidentally got removed from the templates in a previous commit
This is necessary to make convert_to/from_extras() work
…rm_without_tests_second_try
Conflicts: doc/tag-vocabularies.rst removed This needs to be done via the action API (:doc:`api`). Please check the examples section to see which calls are needed.
…y-streams-via-config
…ts instead of the sysadmin user
…s clear in the docs.
Closing this because I made the pr to the wrong branch... |
domoritz
added a commit
that referenced
this pull request
Apr 23, 2013
domoritz
added a commit
that referenced
this pull request
Apr 23, 2013
domoritz
added a commit
that referenced
this pull request
Apr 23, 2013
domoritz
added a commit
that referenced
this pull request
Apr 23, 2013
domoritz
added a commit
that referenced
this pull request
Apr 23, 2013
domoritz
added a commit
that referenced
this pull request
Apr 24, 2013
domoritz
added a commit
that referenced
this pull request
Apr 24, 2013
domoritz
added a commit
that referenced
this pull request
Apr 25, 2013
amercader
added a commit
that referenced
this pull request
Jun 5, 2013
amercader
added a commit
that referenced
this pull request
Jun 5, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Datastore tables that belong to private CKAN resources are not hidden. This could be potentially unexpected even though it says it in the docs http://docs.ckan.org/en/latest/datastore-setup.html.