Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accessRules для главного модуля Yupe #2303

Closed
loveorigami opened this issue Dec 22, 2015 · 0 comments
Closed

accessRules для главного модуля Yupe #2303

loveorigami opened this issue Dec 22, 2015 · 0 comments

Comments

@loveorigami
Copy link

Создал роль - moderator.
Присваиваю ей права... В главном модуле правила не работают.

В модуле есть права доступа
https://github.com/yupe/yupe/blob/master/protected/modules/yupe/YupeModule.php#L851

  public function getAuthItems()
    {
        return [
            [
                'name'        => 'ManageYupeParams',
                'description' => Yii::t('YupeModule.yupe', 'Modules update'),
                'type'        => AuthItem::TYPE_TASK,
                'items'       => [
                    [
                        'type'        => AuthItem::TYPE_OPERATION,
                        'name'        => 'Yupe.YupeBackend.index',
                        'description' => Yii::t('YupeModule.yupe', 'Yupe panel')
                    ],
                    [
                        'type'        => AuthItem::TYPE_OPERATION,
                        'name'        => 'Update.UpdateBackend.update',
                        'description' => Yii::t('YupeModule.yupe', 'Modules update')
                    ],
                ]
            ]
        ];
    }

Однако в контроллере они не описаны.
Поэтому после применения этих правил доступ все равно закрыт.

https://github.com/yupe/yupe/blob/master/protected/modules/yupe/controllers/BackendController.php#L29

    public function accessRules()
    {
        return [
            ['allow', 'roles' => ['admin']],
            ['allow', 'actions' => ['index']],
            ['allow', 'actions' => ['error']],
            ['allow', 'actions' => ['AjaxFileUpload']],
            ['allow', 'actions' => ['AjaxImageUpload']],
            ['allow', 'actions' => ['transliterate']],
            ['deny',],
        ];
    }

И хотелось бы еще на каждую операцию иметь отдельное правило -
Например - разрешить настройки сайта и очищать кеш и запретить настройки тем...

001

@yupe yupe added this to the 0.9.9 milestone Dec 23, 2015
@sabian sabian assigned sabian and unassigned sabian Dec 23, 2015
@sabian sabian modified the milestones: 1.1, 0.9.9 Dec 23, 2015
@yupe yupe modified the milestones: 1.1, 1.2 Nov 7, 2016
@yupe yupe modified the milestones: 1.2, 1.3 Dec 27, 2016
sabian added a commit that referenced this issue Dec 25, 2018
#2303: accessRules для главного модуля Yupe
@dzhedai dzhedai closed this as completed Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants