Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Add Permissions For An Addon Without Permissions Rate Topic   - - - - -

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 22 November 2015 - 06:24 PM #1

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. <item for="install">REPLACE INTO ?:privileges (privilege, is_default, section_id) VALUES ('manage_addon_name', 'Y', 'addons')</item>
    <item for="uninstall">DELETE FROM ?:privileges WHERE privilege LIKE 'manage_addon_name'</item>
    
  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.


Warm Regards,
Admin | MVE: 4.2.4

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3311 posts

Posted 23 November 2015 - 07:15 AM #2

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']

Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19060 posts

Posted 23 November 2015 - 09:18 AM #3

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.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 23 November 2015 - 07:27 PM #4

 

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.


Warm Regards,
Admin | MVE: 4.2.4

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3311 posts

Posted 24 November 2015 - 07:49 AM #5

Try this

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

return $schema;

Or course, replace the '<controller_name>'with your controller name.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19060 posts

Posted 24 November 2015 - 08:48 AM #6

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 30 March 2017 - 10:30 AM #7

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.



 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3311 posts

Posted 30 March 2017 - 10:37 AM #8

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?


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 30 March 2017 - 11:04 AM #9

Hello!

 

Did you try to make the changes described above?

 

yes, I tried to make the changes described above.



 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 31 March 2017 - 04:45 AM #10

yes, I tried to make the changes described above.

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19060 posts

Posted 31 March 2017 - 07:44 AM #11

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 


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 31 March 2017 - 12:16 PM #12

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19060 posts

Posted 31 March 2017 - 02:06 PM #13

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 03 April 2017 - 06:01 AM #14

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.



 
  • imac
  • Head of Product
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2046 posts

Posted 04 April 2017 - 07:21 AM #15

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.


Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • grabbags
  • Senior Member
  • Members
  • Join Date: 14-Aug 07
  • 357 posts

Posted 12 April 2019 - 11:22 PM #16

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!