Post by CartIdeas » Fri Jul 07, 2017 9:45 pm

Opencart 3.x requires the extension files to be placed under 'extension' folder. My controller folder structure is as below

Code: Select all

admin
  |---controller
     |---extension
        |---logger
           |---logger.php
When I navigate to url 'http://<domain>/admin/index.php?route=extension/logger/logger&user_token=xxxx', I am getting 'Permission denied' error. I have already given access to all items for the user group. Even the class definition is correct

Code: Select all

class ControllerExtensionLoggerLogger extends Controller {
I tried to debug the function

Code: Select all

public function hasPermission($key, $value) {
in library\cart\user\user.php

the $value is passed as 'extension\logger' only!. What is going wrong? Could anyone help me?

User avatar
Newbie

Posts

Joined
Sun Dec 04, 2016 1:32 pm

Post by daniGo » Fri Jul 07, 2017 9:51 pm

Open admin/controller/startup/permission.php

and add extension/logger to the array

Code: Select all

$extension = array(
				'extension/dashboard',
				'extension/analytics',
				'extension/captcha',
				'extension/extension',
				'extension/feed',
				'extension/fraud',
				'extension/module',
				'extension/payment',
				'extension/shipping',
				'extension/theme',
				'extension/total',
				'extension/report',
                'extension/openbay'
			);

http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by CartIdeas » Fri Jul 07, 2017 10:00 pm

daniGo wrote:
Fri Jul 07, 2017 9:51 pm
Open admin/controller/startup/permission.php

and add extension/logger to the array
Why do we do that? We cannot ask the extension buyer to do the same. Certainly it must not be the way to develop extension for Opencart 3.x

User avatar
Newbie

Posts

Joined
Sun Dec 04, 2016 1:32 pm

Post by daniGo » Fri Jul 07, 2017 10:06 pm

You can move your extension to
extension/module/logger
This way you don't need to add new directory to the array for permissions.

http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by CartIdeas » Fri Jul 07, 2017 10:15 pm

daniGo wrote:
Fri Jul 07, 2017 10:06 pm
You can move your extension to
extension/module/logger
This way you don't need to add new directory to the array for permissions.
Unfortunately my extension is not really a module to be accessed through Extensions > Module. It is more like an advanced log viewer accessed through System > Maintenance menu. 'extension/module' would not be the right folder to place the files :(.

User avatar
Newbie

Posts

Joined
Sun Dec 04, 2016 1:32 pm

Post by Johnathan » Fri Jul 07, 2017 10:42 pm

Unfortunately, the way OpenCart is designed there's no way to add a new area for a different kind of extension. Generally, if it's not something that would fit in another area, you put it in Modules, even if it doesn't have a module box. If you want another link in the menu, you can then use an ocMod file to add the link to the left-hand menu, so it's directly accessible through another area.

Hopefully one day there will be some type of "Other" area in the Extensions list, for extensions that don't fit in any of the normal areas.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by i.am.retailer » Sat Jul 25, 2020 2:34 pm

Can u check whether the access and modify permissions for extension/module/logger provided in System>>user>>usergroup>>adminstration Edit

New member

Posts

Joined
Thu Jun 04, 2020 2:10 pm

Post by kastoras » Sun Apr 11, 2021 12:00 am

Hi,

this is a solution for anyone who could have this problem.

You don't have to change directly the file mentioned, just add the following modification to your install xml. You need to change `'extension/your_group',` to your`s extension group.

<file path="admin/controller/startup/permission.php">
<operation>
<search><![CDATA['extension/captcha',]]></search>
<add position="after"><![CDATA[
'extension/your_group',
]]></add>
</operation>
</file>

Thanks a lot for the earlier answers that helped me.
Nikos

Newbie

Posts

Joined
Sat Apr 10, 2021 11:53 pm
Who is online

Users browsing this forum: sdd and 24 guests