ACL or workaround for backend access

  • Posts: 3
  • Thank you received: 0
13 years 9 months ago #8962

Hi,

I am aware from some other posts I read that ACL(1.6) for backend access control is a future development.

In the meantime I was wondering if anyone had any work arounds to hide access to the confuration section so that I can allow Administrator class users to edit products etc but only allow superuser class to access the configuration?

Is there a piece of PHP code I could add to the views to only show if the user is a superuser?

Suggestions anyone?

Thanks,

Ben

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #8968

You could edit the file config of the view config via the menu Display->Views. There add a check like that:
$user =& JFactory::getUser();
if($user->gid==25){ // that's only for joomla 1.5
// only for super admin
}

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
13 years 9 months ago #9010

I'm using Joomla 1.6 - will this still work?

Thanks for the quick reply btw.

Ben

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #9033

For 1.6:
$user =& JFactory::getUser();
jimport('joomla.access.access');
$userGroups = JAccess::getGroupsByUser($user->id, true);
if(in_array(8,$userGroups)){ // that's only for joomla 1.6 and supposing that you didn't change the groups too much
// only for super admin
}

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
13 years 9 months ago #9087

Thanks that's great.

Are the save and and apply buttons going to do any thing or can I ignore those?

Cheers,

Ben

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #9094

They won't work. You can ignore them

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum