crisu83 / yii-rights

Automatically exported from code.google.com/p/yii-rights
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

problem with controller in subfolder #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. controller under controller subfolder (ie: 
protected/controller/Data/MyController.php)
2. Generate items for controller actions create only My.* 
3. checkaccess return false, it works with Data/My.*

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
yii 1.1.6, rights 1.2, macosx

Please provide any additional information below.
i modified RGenerator::getControllersInPath with one more parameters that is 
parentFolder

Original issue reported on code.google.com by marco.pa...@gmail.com on 10 Mar 2011 at 8:05

Attachments:

GoogleCodeExporter commented 9 years ago
Hello Marco,

You fix seems to be alright. I'll take a look at the generator to implement a 
fix for this problem. Thanks for reporting this issue.

Original comment by Christof...@gmail.com on 12 Mar 2011 at 12:07

GoogleCodeExporter commented 9 years ago
if there are two controllers with the same name, but in different folders, the 
first doesn't appears in rights/authItem/generate. Then I modified 
RGenerator::getControllersInPath as follows:

$controllers[ strtolower($parentFolder . $name) ] = array(
                            'name'=> $parentFolder . $name,
                            'file'=>$entry,
                            'path'=>$entryPath,
                        );

then controllers key are unique

Original comment by marco.pa...@gmail.com on 26 Mar 2011 at 5:39

GoogleCodeExporter commented 9 years ago
Hello marco,

I looked deeper into this and I cannot think of a good way to implement this 
without 
breaking the support for the automatic controller access checking 
(ControllerId.ActionID). If I start appending parents they won't match the 
permission the filter checks for. Sorry for the inconvenience.

Original comment by Christof...@gmail.com on 31 Mar 2011 at 8:52

GoogleCodeExporter commented 9 years ago
no problem, but I think it's better to check complete path 
(Path/ControllerId.ActionID) than to renounce this feature.

IMHO

Original comment by marco.pa...@gmail.com on 3 Apr 2011 at 8:44

GoogleCodeExporter commented 9 years ago
Well I'm all for it if you can think of a way to generate the permission name 
e.g. Path.ControllerId.ActionId for the automatic controller access control.

Original comment by Christof...@gmail.com on 6 Apr 2011 at 6:40

GoogleCodeExporter commented 9 years ago
this works for me, only with little mod to getControllersInPAth

Original comment by marco.pa...@gmail.com on 6 Apr 2011 at 7:18

Attachments: