Post by nektar » Thu Feb 26, 2015 10:21 pm

Hello.

I have a user group called Operators.

I need to give access to these users to a specific module in Extensions. BUT i dont want them to see all the other modules that are installed.

So far their access was denied to the Extensions list. When i gave them permissions for the specific module they still couldnt access it nor the Extensions list. I then tried and gave them access to /module and /manager (access and modify) but this way they could see all the installed modules.

How can i hide all the modules I dont want them to see and only show them the specific module?

OpenCart version i use 1.5.64

Thanks in advance!!!

New member

Posts

Joined
Wed Jul 24, 2013 12:03 am

Post by IP_CAM » Fri Feb 27, 2015 4:57 am

Did you 'group them' and set 'set' their access rights in the 'Admin / System / User / Usergroups / Whatever' ?
You probably can't make everything invisible, but at least not 'usable', but I'm not sure about this 'visible', since I never tried it yet...
Ernie
bigmax.ch/shop/

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by nektar » Fri Feb 27, 2015 2:40 pm

As i explained earlier, this group members cant use any other modules in Extension list, but they can vuew them all.

New member

Posts

Joined
Wed Jul 24, 2013 12:03 am

Post by pprmkr » Fri Feb 27, 2015 3:57 pm

nektar wrote:I need to give access to these users to a specific module in Extensions. BUT i dont want them to see all the other modules that are installed.
To hide modules from list where user does not have acces permission.

Edit admin/controller/extension/module.php

Find:

Code: Select all

$extension = basename($file, '.php');
Add after:

Code: Select all

				if (!$this->user->hasPermission('access', 'module/'.$extension)) {
					continue;
				}
You can do the same with payment, shipping and total.

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by pprmkr » Fri Feb 27, 2015 4:10 pm

vQmod to hide modules, feeds, totals, shipping, payment if user does not have acces permission.

Attachments


User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by nektar » Fri Feb 27, 2015 6:03 pm

Thx guys.

I will give it a try this afternoon, when i get back to office and keep you informed.

Hope this VQmod works with opencart 1.5.64 and with future upgrade to ver 2.

New member

Posts

Joined
Wed Jul 24, 2013 12:03 am

Post by nektar » Sun Mar 01, 2015 6:47 pm

pprmkr I havent tried the code but it should work.

I preffered the VQMod. I works as expected!!!

Where can we find this VQMod in order to upgrade it later for Opencart ver 2?

THanks again for the support!

New member

Posts

Joined
Wed Jul 24, 2013 12:03 am

Post by pprmkr » Sun Mar 01, 2015 9:59 pm

OCMod for version 2.0.0.*

Attachments


User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by nektar » Tue Mar 03, 2015 2:35 am

WOW u r great mate.

Thx!

New member

Posts

Joined
Wed Jul 24, 2013 12:03 am

Post by wonderland » Fri Mar 31, 2017 3:08 pm

I was wondering how I could make this work for OC 2.3?
I tried editing the original file by changing the path from

Code: Select all

admin/controller/extension/module.php
to

Code: Select all

admin/controller/extension/extension/module.php
But it just hides all modules, no matter the permissions.

New member

Posts

Joined
Wed Jun 15, 2011 8:25 pm

Post by nektar » Fri Mar 31, 2017 4:27 pm

Of course it does. you changed the path of the folders so it looks there admin/controller/extension/extension/module.php where there are no modules.

New member

Posts

Joined
Wed Jul 24, 2013 12:03 am

Post by wonderland » Fri Mar 31, 2017 5:23 pm

It points to the same file and targets the same code line as in original mod though. If I understand correctly OC 2.3 changed module layout and file structure a little bit.

Besides, in the newest OC version there is no module.php file in the original modification path

Code: Select all

admin/controller/extension/module.php

New member

Posts

Joined
Wed Jun 15, 2011 8:25 pm

Post by mehrshid » Sat Aug 04, 2018 12:03 am

pprmkr wrote:
Sun Mar 01, 2015 9:59 pm
OCMod for version 2.0.0.*
It working fine also with OC 3.0.2
But a question : Is there any way to hide an extension in extension list?

Newbie

Posts

Joined
Sat Aug 04, 2018 12:01 am

Post by Renecek » Thu Dec 12, 2019 7:04 pm

doesn't work with OC 3.0.2.0.
Any update please?

New member

Posts

Joined
Thu Dec 10, 2015 7:12 pm

Post by xxvirusxx » Fri Dec 13, 2019 1:53 am

Renecek wrote:
Thu Dec 12, 2019 7:04 pm
doesn't work with OC 3.0.2.0.
Any update please?
LE: Edit: Added @pprmkr code from page 2

Attachments

Last edited by xxvirusxx on Mon Jan 25, 2021 11:27 pm, edited 1 time in total.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Etheravion » Sun Jan 24, 2021 4:17 pm

xxvirusxx wrote:
Fri Dec 13, 2019 1:53 am
Renecek wrote:
Thu Dec 12, 2019 7:04 pm
doesn't work with OC 3.0.2.0.
Any update please?
Could you please make one for OC2.3.0.2 and compatible with your Condor2 version?

New member

Posts

Joined
Wed Oct 17, 2012 9:16 pm

Post by xxvirusxx » Sun Jan 24, 2021 4:27 pm

Should work

Edit: Added @pprmkr code from page 2

Attachments

Last edited by xxvirusxx on Mon Jan 25, 2021 11:19 pm, edited 1 time in total.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Etheravion » Sun Jan 24, 2021 5:01 pm

xxvirusxx wrote:
Sun Jan 24, 2021 4:27 pm
Should work
Wow, it works! Thanks!

If you could improve the count to reflect the actual shown, that would be awesome! Nevertheless, I'm gonna buy you a beer. Cheers!
Image

New member

Posts

Joined
Wed Oct 17, 2012 9:16 pm

Post by xxvirusxx » Sun Jan 24, 2021 7:50 pm

I think involve more code.

At this moment extensions are counted by total numbers of php files

Code: Select all

$files = glob(DIR_APPLICATION . 'controller/extension/' . $extension . '/*.php', GLOB_BRACE);
Then heading_title is displayed by total numbers of files, and not based of user permissions

Code: Select all

'text' => $this->language->get('extension')->get('heading_title') . ' (' . count($files) .')',
I will think of a possibility to count only files based on user permissions.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Etheravion » Sun Jan 24, 2021 8:22 pm

I will think of a possibility to count only files based on user permissions.
Awesome! :D

New member

Posts

Joined
Wed Oct 17, 2012 9:16 pm
Who is online

Users browsing this forum: Amazon [Bot] and 123 guests