Page 1 of 1

Custom Links on Home by USER

Posted: 2018-08-06 15:28
by naturick
Hello. pböttcher just solved me a problem. I think that it can be implemented on Appgini core.

I needed to restrict visability of some custom links in home page to a specific USER.

USER is memmebr of a GROUP that I didn't want to show links to.

Actually Appgini allow this restriction by GROUP.

Solution is very easy:

What you can do, if you need this, you can add

Code: Select all

'users' => array('user1', 'users'), // array of users allowed to see the custom link
in the links-home.php

and change the following in the incCommon.php file (get_home_links function // arround line 1300)

Code: Select all

if($memberInfo['admin'] || @in_array($memberInfo['group'], $link['groups']) || @in_array('*', $link['groups'])){
to

Code: Select all

if($memberInfo['admin'] || @in_array($memberInfo['group'], $link['groups']) || @in_array('*', $link['groups']) || @in_array($memberInfo['username'], $link['users'])){


Of course this change will be overwritten every time application is recreated/published.

Re: Custom Links on Home by USER

Posted: 2018-08-23 14:16
by a.gneady
Thanks for sharing, @naturick. I've added this to our backlog to implement it in future releases :)