Skip to content

Commit

Permalink
Fix: unprivileged user can add references to a applicant
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Gneady committed Jul 3, 2021
1 parent 2dc485e commit 5a748f5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/hooks/references.php
@@ -1,10 +1,10 @@
<?php
// For help on using hooks, please refer to http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks

function references_init(&$options, $memberInfo, &$args){
/* Inserted by Search Page Maker for AppGini on 2020-11-18 12:19:27 */
$options->FilterPage = 'hooks/references_filter.php';
/* End of Search Page Maker for AppGini code */
function references_init(&$options, $memberInfo, &$args){
/* Inserted by Search Page Maker for AppGini on 2020-11-18 12:19:27 */
$options->FilterPage = 'hooks/references_filter.php';
/* End of Search Page Maker for AppGini code */


return TRUE;
Expand Down Expand Up @@ -75,6 +75,8 @@ function references_footer($contentType, $memberInfo, &$args){
}

function references_before_insert(&$data, $memberInfo, &$args){
// can current user view this parent?
if(!check_record_permission('applicants_and_tenants', $data['tenant'])) return false;

return TRUE;
}
Expand All @@ -85,6 +87,8 @@ function references_after_insert($data, $memberInfo, &$args){
}

function references_before_update(&$data, $memberInfo, &$args){
// can current user view this parent?
if(!check_record_permission('applicants_and_tenants', $data['tenant'])) return false;

return TRUE;
}
Expand Down

0 comments on commit 5a748f5

Please sign in to comment.