Currently, unpublished skus can still be added to orders via the admin order pages.

CommentFileSizeAuthor
#12 1054028-order-admin-node-access.patch1.49 KBlongwave
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TR’s picture

I think the admin should be allowed to do anything - even add a product that's not yet (or no longer) available to the general public.

longwave’s picture

Status: Active » Closed (won't fix)

I have a store where unpublished items are used in the admin pages; for some items there is limited stock and they are not always available directly via the website (products are unpublished) but customers may call and have an item added to their order manually. As TR says, a store admin can and should be able to do things that their customers cannot.

Coyote’s picture

Here's the problem - there isn't one admin on this site. There are several people with enough administrative abilities to create orders for customers, but they should _not_ be allowed to sell products that are no longer for sale.

Sure, it's great for the superadmin account or privileged accounts to do special things, but this is a case where a store employee should not be allowed to do something that a manager is allowed to do.

Coyote’s picture

Status: Closed (won't fix) » Active

Bump?

longwave’s picture

I guess this calls for a new permission, "view unpublished products" or similar, that is checked on the create order pages, but this is probably better off in a contrib module than in core, unless someone wants to provide a fairly simple patch for it.

longwave’s picture

TR’s picture

Version: 6.x-2.4 » 7.x-3.x-dev

New features should go into 7.x-3.x first.

SilviuChingaru’s picture

Assigned: Unassigned » SilviuChingaru
longwave’s picture

Do we need a new permission here, or is "administer products" enough? Or what about "bypass node access" that node.module provides?

SilviuChingaru’s picture

I think bouth should be used with OR...

longwave’s picture

Even simpler, should we just use node_access(), so any user can only add products that they currently have permission to view? As we already use this for adding items to the cart, it makes sense to use the same rules on the admin side as well.

longwave’s picture

Status: Active » Needs review
FileSize
1.49 KB

The attached patch converts the query used here to use the node_access tag, so admins can only add products that they have permission to view.

longwave’s picture

Status: Needs review » Fixed

Commited #12.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

SilviuChingaru’s picture

Assigned: SilviuChingaru » Unassigned
Issue summary: View changes