Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

dashboard.rst 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. =========
  2. Dashboard
  3. =========
  4. The dashboard is the backend interface for managing the store. That includes the
  5. product catalogue, orders and stock, offers etc. It is intended as a
  6. complete replacement of the Django admin interface.
  7. The app itself only contains a view that serves as a kind of homepage, and
  8. some logic for managing the navigation (in ``nav.py``). There's several sub-apps
  9. that are responsible for managing the different parts of the Oscar store.
  10. Permission-based dashboard
  11. --------------------------
  12. Staff users (users with ``is_staff==True``) get access to all views in the
  13. dashboard. To better support Oscar's use for marketplace scenarios, the
  14. permission-based dashboard has been introduced. If a non-staff user has
  15. the ``partner.dashboard_access`` permission set, they are given access to a subset
  16. of views, and their access to products and orders is limited.
  17. :class:`~oscar.apps.partner.abstract_models.AbstractPartner` instances
  18. have a :attr:`~oscar.apps.partner.abstract_models.AbstractPartner.users` field.
  19. Prior to Oscar 0.6, this field was not used. Since Oscar 0.6, it is used solely
  20. for modelling dashboard access.
  21. If a non-staff user with the ``partner.dashboard_access`` permission is in
  22. :attr:`~oscar.apps.partner.abstract_models.AbstractPartner.users`, they can:
  23. * Create products. It is enforced that at least one stock record's partner has
  24. the current user in ``users``.
  25. * Update products. At least one stock record must have the user in the stock
  26. record's partner's ``users``.
  27. * Delete and list products. Limited to products the user is allowed to update.
  28. * Managing orders. Similar to products, a user get access if one of an order's
  29. lines is associated with a matching partner. By default, user will get
  30. access to all lines of the order, even though supplies only one of them.
  31. If you need user to see only own lines or apply additional filtering - you
  32. can customise
  33. :meth:`~oscar.apps.dashboard.order.views.OrderDetailView.get_order_lines`
  34. method.
  35. For many marketplace scenarios, it will make sense to ensure at checkout that
  36. a basket only contains lines from one partner.
  37. Please note that the dashboard currently ignores any other permissions,
  38. including `Django's default permissions`_.
  39. .. note::
  40. The permission-based dashboard currently does not support parent or child
  41. products. Supporting this requires a modelling change. If you require this,
  42. please get in touch so we can first learn about your use case.
  43. .. _Django's default permissions: https://docs.djangoproject.com/en/stable/topics/auth/default/#default-permissions
  44. Abstract models
  45. ---------------
  46. None.
  47. Views
  48. -----
  49. .. automodule:: oscar.apps.dashboard.views
  50. :members: