This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » General » Weird behaviour with module permissions
expandshrink

Weird behaviour with module permissions

Weird behaviour with module permissions

Sunday 26 August 2012 7:30:04 pm - 2 replies

Hello,

I created a module (mymodule) with a single function (myfunction), declared in module.php, and I'm trying to set users permissions to access it.

When I grant the mymodule/myfunction combination to the anonymous role, I'm not authorised to access the corresponding url with a non logged in user. To make it work, I need to grant access to 'all' functions (i.e. without restrictions) of my module.

Did anyone have the same problem?

Thanks

Monday 27 August 2012 9:21:39 am

Hi,

This function name is declared in module.php in "functions" array as in the following example ("buy" function):

$ViewList["orderview"] = array(
    "functions" => array( 'buy' ),
    "script" => "orderview.php",
    "default_navigation_part" => 'ezshopnavigationpart',
    "params" => array( "OrderID" ) );

Then you have to declare the "buy" function constraints at end of file module.php:

$FunctionList['buy'] = array( );

The above example shows the most general limitation for this function.

Check module.php files to see how it is done.

Cheers

Tuesday 28 August 2012 3:53:33 pm

Quote from Karol Radziuk :

Hi,

This function name is declared in module.php in "functions" array as in the following example ("buy" function):

$ViewList["orderview"] = array(
    "functions" => array( 'buy' ),
    "script" => "orderview.php",
    "default_navigation_part" => 'ezshopnavigationpart',
    "params" => array( "OrderID" ) );

Then you have to declare the "buy" function constraints at end of file module.php:

$FunctionList['buy'] = array( );

The above example shows the most general limitation for this function.

Check module.php files to see how it is done.

Cheers

Thanks! I was missing the 'functions' parameter in the ViewList array

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from