Skip to main content

ACL or workaround for backend access

More
15 years 7 months ago #8962 by hawkestfs
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.

More
15 years 7 months ago #8968 by nicolas
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.

More
15 years 7 months ago #9010 by hawkestfs
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.

More
15 years 7 months ago #9033 by nicolas
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.

More
15 years 7 months ago #9087 by hawkestfs
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.

More
15 years 7 months ago #9094 by nicolas
They won't work. You can ignore them

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

Time to create page: 0.174 seconds
Powered by Kunena Forum