How does the authorize function work??
- jameswadsworth
-
Topic Author
- Offline
Less
More
14 years 3 months ago - 14 years 3 months ago #55085
by jameswadsworth
How does the authorize function work?? was created by jameswadsworth
Hello, we have been developing a class to manage product supplier data
(see this thread for the outline)
. Everything was working great until we updated to 1.5.8. Now when we view the supplier listing we get a 403 - access forbidden message. We have traced this to a modification of the function authorize () in the admin helper.php file. If we comment out the follow lines of code
if(!$this->isIn($task,array('modify_views','add','modify','delete','display'))){
return false;
}
our product supplier listings reappear. Looking at other controllers and classes I cannot work out what changes need to made to allow our supplier listings to be viewed. Any suugestions most welcome.
This is all in the admin part of the site.
Thansk, James
if(!$this->isIn($task,array('modify_views','add','modify','delete','display'))){
return false;
}
our product supplier listings reappear. Looking at other controllers and classes I cannot work out what changes need to made to allow our supplier listings to be viewed. Any suugestions most welcome.
This is all in the admin part of the site.
Thansk, James
Last edit: 14 years 3 months ago by jameswadsworth.
Please Log in or Create an account to join the conversation.
14 years 3 months ago #55118
by nicolas
Replied by nicolas on topic Re: How does the authorize function work??
Hi,
The task (function) of your controller needs to be registered in one of the attributes of the controller class: $modify_views, $add, $modify, $delete or $display.
You can see that we have all the tasks there at the beginning of the controllers class definition.
The task (function) of your controller needs to be registered in one of the attributes of the controller class: $modify_views, $add, $modify, $delete or $display.
You can see that we have all the tasks there at the beginning of the controllers class definition.
The following user(s) said Thank You: jameswadsworth
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
14 years 3 months ago #55288
by jameswadsworth
Replied by jameswadsworth on topic Re: How does the authorize function work??
Hi Nicolas, thanks for the pointer. The reason why it had stopped working with the latest version of the authorize function is that we were missing the square brackets after our this->diplay in our supplierContoller and therefore the listing display was not in the array.
Please Log in or Create an account to join the conversation.
Time to create page: 0.128 seconds