See the records in a table when they are represented as child records even if you are not authorized to see that table

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
fgazza
Veteran Member
Posts: 205
Joined: 2019-04-30 17:37

See the records in a table when they are represented as child records even if you are not authorized to see that table

Post by fgazza » 2019-06-28 08:27

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

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab

Post by jsetzer » 2019-06-28 14:13

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:
  1. Allow the group to view the records using group-permissions in admin-area
  2. In your appGini project, [X] Hide link in homepage
  3. and [X] Hide link in navigation menu
  4. and uncheck [ ] participants in Detail view settings / "Display a link to children records from" field
  5. 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
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

fgazza
Veteran Member
Posts: 205
Joined: 2019-04-30 17:37

Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab

Post by fgazza » 2019-06-29 12:22

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

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab

Post by jsetzer » 2019-06-29 16:03

Hi Fabiano,
you are right, except that I'm not Pascal :lol:
Best,
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools


pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: See the records in a table when they are represented as child records even if you are not authorized to see that tab

Post by pbottcher » 2019-06-30 09:18

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;
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply