hamednourhani / yii-rights

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

Wrong generated permissions for modules in another module #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I have rights in my project
2. I have admin module in project
3. In admin module there is another module catalog
4. Call rights/authItem/generate

What is the expected output? What do you see instead?
Rights generates permissin Catalog.* instead of Admin.Catalog.*, 
Catalog.XyzController.* instead of Admin.Catalog.XyzController.*,
Catalog.XyzController.XyzAction instead of 
Admin.Catalog.XyzController..XyzAction.

What version of the product are you using? On what operating system?
Rights v1.3.0, OS Windows 7

Please provide any additional information below.

I solve this problem such:
1) rights/views/_generateItems.php ( lines 47-61 )
<?php foreach( $items['modules'] as $inModuleName=>$moduleItems ): ?>

        <tr><th class="module-row" colspan="3"><?php echo ucfirst($inModuleName).'Module'; ?></th></tr>

        <?php $this->renderPartial('_generateItems', array(
            'model'=>$model,
            'form'=>$form,
            'items'=>$moduleItems,
            'existingItems'=>$existingItems,
            'moduleName'=>isset($moduleName) ? $moduleName.".".ucfirst($inModuleName) : $inModuleName,
            'displayModuleHeadingRow'=>false,
            'basePathLength'=>$basePathLength,
        )); ?>

    <?php endforeach; ?>
2) rights/components/RightsFilter.php ( line 36)
if( ($module = $controller->getModule())!==null )
            {
                            //$authItem .= ucfirst($module->id).'.';
                            $expl = explode('/', $module->id);
                            foreach($expl as $item)
                            {
                                $authItem .= ucfirst($item).'.';
                            }

                        }

Original issue reported on code.google.com by Nasedkin...@gmail.com on 12 Oct 2011 at 9:48