Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Contributed modules
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 May 2015 at 11:13 UTC
Updated:
8 Mar 2017 at 10:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
oturpin commentedHello,
Here is the explanation: digging into code, one can read:
if (user_access('create payments', $account)) {
// We currently allow any user to create any payment transaction,
// regardless of the order, because entity_access() doesn't give us a
// way to discriminate on the order.
// @todo: find a way to prevent creating a payment transaction if the
// user doesn't have access to the order.
if (!isset($order) || commerce_order_access('update', $order, $account)) {
return TRUE;
}
So, "create" is the good one, but is not enough => user MUST have update permission on the related order.
Problem is :
-> I don't want a user to modify orders, once validated.
-> I want to allow user submitting payments for non-balanced orders.
Then, I have to remove that piece of code related to the order permission.
Comment #2
rszrama commentedI really think what you're looking for is not the functionality core intends to provide with this interface. You should instead consider creating a custom module that adds a payment management interface to the customer's order screen. Let us know here if you release such a module so we can check it out! : )
Comment #3
oturpin commentedHi All,
I modified this function: function commerce_payment_transaction_order_access($op, $order, $account = NULL)
And removed the test : // if (!isset($order) || commerce_order_access('update', $order, $account)) { }
Then , it now returns the user_access('create payments', $account)) permission.
This is exactly what I needed: each time a user views an order, the payment table is drawn and the user has the ability to apply for a new payment transaction.
You are probably right. I should write a module for that... But Not enough skilled for the time being...
Thx
Comment #4
karingIf the user/role has the permission 'create payments' - what is the reasoning behind the fact that a user/role also must have 'update order' permissions - before the Add payment button shows up on their /admin/commerce/orders/[id]/payment screen? I really don't want users to update line-items - but I do want them to add payments!
Comment #5
karingThis is with #3:
Comment #6
bojanz commentedThis is not a feature Commerce will be supporting within its code. People are free to implement it in contrib, but no need to track it here.