Add Permissions For An Addon Without Permissions

Hi,

We wanted to add permissions for the addon which donot need to be available for a non admin user but dont have the permission built in the addon.

I figured out the part that we need to do 2 things :

  1. Add 2 row in privileges table for the same or add it in the addon.xml and reinstall the addon
  2. REPLACE INTO ?:privileges (privilege, is_default, section_id) VALUES ('manage_addon_name', 'Y', 'addons')
    DELETE FROM ?:privileges WHERE privilege LIKE 'manage_addon_name'
    
  3. Create a file admin.post.php
  4.  $schema['addon_name'] = array (
                'modes' => array(
                	'manage' => array(
                		'permissions' => 'manage_adddon_name'
            		),
                ),
            );
    

    return $schema;


    I am now able to see the Addon name in the Privileges Page but it has no effect if I dont provide the permission to a certain user group , the users are still able to see the addon menu item.


Am I missing something else.

You should also add a row to the 'usergroup_privileges' table for usergroup 4

REPLACE INTO ?:usergroup_privileges (usergroup_id, privilege) VALUES (4, 'manage_addon_name')

As for the 'schema', you can apply a permission only for controller/mode. So you should not use this:

$schema['addon_name']

You should use the following:

$schema['controller_name']

At first, please check if the new permission is displayed in the list of permissions in the admin panel:

http://prntscr.com/95x1iw

If yes, please correct the schema according to simtechdev notes and do not forget to clear cache after the schema is changed.

You should also add a row to the 'usergroup_privileges' table for usergroup 4

REPLACE INTO ?:usergroup_privileges (usergroup_id, privilege) VALUES (4, 'manage_addon_name')

As for the 'schema', you can apply a permission only for controller/mode. So you should not use this:

$schema['addon_name']

You should use the following:

$schema['controller_name']

I did these changes but still the menu shows for that addon , when i click on the menu options it gives 403 access denied but i want the menu option to not be displayed.

Try this

$schema[''] = array (
        'modes' => array (
            'manage' => array (
                'permissions' => 'manage_adddon_name'
            ),
        ),
        'permissions' => 'manage_adddon_name'
    );

return $schema;

Or course, replace the ''with your controller name.

If it still does not work, PM me and we will check the issue on your server

Hi,

I have one problems. I assign permissions to display orders and products page in sub admins but some custom addons also displaying. how to create permissions in custom addons and pages.

Regards,

Naga mahesh bondada,

maheshbondada@gmail.com.

Hi,

I have one problems. I assign permissions to display orders and products page in sub admins but some custom addons also displaying. how to create permissions in custom addons and pages.

Regards,

Naga mahesh bondada,

maheshbondada@gmail.com.

Hello!

Did you try to make the changes described above?

Hello!

Did you try to make the changes described above?

yes, I tried to make the changes described above.

yes, I tried to make the changes described above.

Please help me. How to how to create permissions in custom addons and pages.

Please help me. How to how to create permissions in custom addons and pages.

Provide with the example of the addon which should be hidden.Screenshot will be much appreciated

Provide with the example of the addon which should be hidden.Screenshot will be much appreciated

I give permissions in one sub admin. After that, sub admin login to display only products and orders page otherwise full access.

i am posting screen shot it doesn't take. please give me any email id and send screen shots.

I give permissions in one sub admin. After that, sub admin login to display only products and orders page otherwise full access.

i am posting screen shot it doesn't take. please give me any email id and send screen shots.

PM me temporary FTP access and details. We will check it on Monday

PM me temporary FTP access and details. We will check it on Monday

actually I am working on localhost and I don't FTP access and details.

actually I am working on localhost and I don't FTP access and details.

Dear nagamahesh22,

If you want to get help you need to provide as much details as possible.

Simple answers won't help others to understand your problems and what you are doing.

Be more constructive and meaningful.

Can someone kindly provide a little bit more detail on how to create/add permission for add-ons? I was trying to enable Google Export & Data Feeds on a selected group.

I don't want to enable "view_catalog" & "manage_catalog" permission. Please advise.

Thank you!

I think the documentation (is there any?!) around configuring permission in CS-CART could also be improved or written. It is very useful to have this feature in built, but not so useful when trying to decipher how to define your own schema.