Page 1 of 1
See the records in a table when they are represented as child records even if you are not authorized to see that table
Posted: 2019-06-28 08:27
by fgazza
Hi everyone.
I need help solving this problem:
I would like to allow a group NOT authorized to see the "participants" table to see the records of the "participants" table when these records are displayed as childs records in the detailed view of the "activity" table.
Any suggestion?
Thanks!
Fabiano
Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab
Posted: 2019-06-28 14:13
by jsetzer
Hi Fabiano,
in AppGini standard I don't see any
bullet-proof solution using project settings and hooks only, but you may try the following which may give you >90% of the expected result:
- Allow the group to view the records using group-permissions in admin-area
- In your appGini project, [X] Hide link in homepage
- and [X] Hide link in navigation menu
- and uncheck [ ] participants in Detail view settings / "Display a link to children records from" field
- In Parent/Children settings set "participants" [X] Enabled
These steps will...
- ...allow the group members to see the records in children tabs of "Activity" details view
- ...remove the "Participants" button at the top of the "Activity" details view
- ...hide "Participants" table from the home / dashboard
- ...hide "Participants" from the dropdown menu
Backdraw
I admit, if users know the URL and navigate to
participants_view.php they will be able to see the records in table view.
Workaround
You can modify SQL-query in participants_init() function. Try adding an negative condition to the SQL-"WHERE" clause" like "1=0" for example. No records should be returned and displayed with this WHERE-clause.
Code: Select all
function participants_init(&$options, $memberInfo, &$args)
{
$options->QueryWhere = "1=0";
return TRUE;
}
I have roughly tested it, but not in all variations. Can this be a workaround for you?
Kind Regards,
Jan
Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab
Posted: 2019-06-29 12:22
by fgazza
Hi Pascal and thanks for your reply.
Unfortunately your sfirst suggestion would make that no group can see the table on the home page while I would like other groups to see the table.
Moreover, with the second suggestion, if I have not misunderstood it, the records would remain invisible but not the table which would appear, even if empty.
I hope there are new ideas and new suggestions.
Thank you!
Fabiano
Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab
Posted: 2019-06-29 16:03
by jsetzer
Hi Fabiano,
you are right, except that I'm not Pascal
Best,
Jan
Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab
Posted: 2019-06-30 06:21
by fgazza
Ops! Sorry!

Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab
Posted: 2019-06-30 09:18
by pbottcher
Hi Fabiano,
you can try this:
Code: Select all
function participants_init(&$options, $memberInfo, &$args)
{
if ($memberInfo['group'] == "YOURGROUPTHATSHOULDNOTSEETHERECORDS") {
return FALSE;
}
return TRUE;
}
This will show to the group an empty page.
As alternativ you could redirect the users of that group via
Code: Select all
function participants_init(&$options, $memberInfo, &$args)
{
if ($memberInfo['group'] == "YOURGROUPTHATSHOULDNOTSEETHERECORDS") {
redirect($URL);
exit;
}
return TRUE;
}