Skip to content
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

Document the use of wildcard parent_ids in Storage.get_all #1617

Merged
merged 1 commit into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion kinto/core/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,19 @@ def callback(context, name, ob):


class UserResource:
"""Base resource class providing every endpoint."""
"""Base resource class providing every endpoint.

Resources inheriting from UserResource are automatically "scoped"
by user (see get_parent_id()), with the effect that one user
cannot look at another user's data. This is good for implementing
sensitive or private information such as accounts.

However, most resources in Kinto can be shared by different users,
with different levels of access determined by their
permissions. Those resources should inherit from
ShareableResource, below.

"""

default_viewset = ViewSet
"""Default :class:`kinto.core.resource.viewset.ViewSet` class to use when
Expand Down
6 changes: 5 additions & 1 deletion kinto/core/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ def get_all(self, collection_id, parent_id, filters=None, sorting=None,
"""Retrieve all objects in this `collection_id` for this `parent_id`.

:param str collection_id: the collection id.
:param str parent_id: the collection parent.

:param str parent_id: the collection parent, possibly
containing a wildcard '*'. (This can happen when
implementing "administrator" operations on a UserResource,
for example.)

:param filters: Optionally filter the objects by their attribute.
Each filter in this list is a tuple of a field, a value and a
Expand Down