Skip to content

Commit

Permalink
Fix: unprivileged user can add item to a price-history
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Gneady committed Jul 3, 2021
1 parent 4464095 commit 217a7b2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/hooks/item_prices.php
Expand Up @@ -25,10 +25,10 @@
* an error message to the user and stop displaying any data).
*/

function item_prices_init(&$options, $memberInfo, &$args) {
/* Inserted by Search Page Maker for AppGini on 2020-11-25 06:38:04 */
$options->FilterPage = 'hooks/item_prices_filter.php';
/* End of Search Page Maker for AppGini code */
function item_prices_init(&$options, $memberInfo, &$args) {
/* Inserted by Search Page Maker for AppGini on 2020-11-25 06:38:04 */
$options->FilterPage = 'hooks/item_prices_filter.php';
/* End of Search Page Maker for AppGini code */


return TRUE;
Expand Down Expand Up @@ -158,6 +158,8 @@ function item_prices_footer($contentType, $memberInfo, &$args) {
*/

function item_prices_before_insert(&$data, $memberInfo, &$args) {
// can current user view the item to which this item_price is assigned?
if(!check_record_permission('items', $data['item'])) return false;

return TRUE;
}
Expand Down Expand Up @@ -211,6 +213,8 @@ function item_prices_after_insert($data, $memberInfo, &$args) {
*/

function item_prices_before_update(&$data, $memberInfo, &$args) {
// can current user view the item to which this item_price is assigned?
if(!check_record_permission('items', $data['item'])) return false;

return TRUE;
}
Expand Down

0 comments on commit 217a7b2

Please sign in to comment.