By David Montoya on Sunday, 18 March 2018
Posted in General Issues
Replies 10
Likes 0
Views 390
Votes 0
Is it possible to hide links and disable access to the Users page and related pages with ACL? I need the users list to be viewable to only certain groups.
Poking around in the templates, for example the toolbar, probably not. Looking at the file:

components/com_easysocial/themes/wireframe/toolbar/default.php

The People link is hard-coded.

<li class="<?php echo $highlight == 'users' ? 'is-active' : '';?>">
<a href="<?php echo ESR::users();?>" class="es-navbar__footer-link">
<i class="fa fa-users"></i>
<span>
<?php echo JText::_('COM_EASYSOCIAL_TOOLBAR_PEOPLE');?>
</span>
</a>
</li>
·
Sunday, 18 March 2018 02:20
·
0 Likes
·
0 Votes
·
0 Comments
·
In my opinion, you can add a checking in this user view here JoomlaFolder/components/com_easysocial/views/users/view.html.php , so this will prevent those user unable to access the page who already know the exact user page URL.
·
Sunday, 18 March 2018 11:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Could you clarify "add a checking in this user view"? I need ACL for view=users not only for guests but registered users as well. Only after certain criteria are met do registered users get be promoted to another user level to view other users.

If not immediately supported what's the best way of adding ACL without breaking core? Is this something that could be paid to be developed and added to core for the rest of the community?
·
Sunday, 18 March 2018 19:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey David,

It's not going to be possible out of the box as we do not have such ACL checks on views. What sort of criterias are you looking at?
·
Sunday, 18 March 2018 19:59
·
0 Likes
·
0 Votes
·
0 Comments
·
I realized, after disabling SEF URLs, that viewing the user's own profile requires view=users. To clarify, I'd need to disable any means of viewing other users.

The People Link in the toolbar


The scenario for this site is as follows:

Three core tiers of users:

  • Sellers
  • Buyers
  • Administrators/Super Users


Where ACL existed I could go crazy with viewing rights, but for now all that is necessary is that sellers can't see anyone, while buyers and administrators can.

One work-around I thought of would be to create a hidden menu with all the User links that need ACL. However, the links that exist hard-coded in the wireframe template still need to be handled conditionally as well as direct links to user profiles, and I'm not sure yet how to approach that.

While Job Board and Seller Marketplace extensions do exist for a similar purpose, I find I can achieve more by repurpoing ES.
·
Monday, 19 March 2018 04:02
·
0 Likes
·
0 Votes
·
0 Comments
·
For now, I'm going to give this a spin. Had no idea it existed until I consulted the Facebook Joomla group.

Conditional Content
·
Monday, 19 March 2018 05:25
·
0 Likes
·
0 Votes
·
0 Comments
·
You can try use this following code to check whether this logged in user have permission to access on user page.


// retrieve the current logged in user data
$user = JFactory::getUser();

// restricted this user group id unable to access user page
$sellerGroup = 2;

// if the current logged in user belong to these restricted group then don't allow access
if (in_array($sellerGroup, $user->groups)) {
echo "unable to access";
} else {
echo "can access";
}
exit;
·
Monday, 19 March 2018 11:17
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post