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

Call to a member function checkAccess() on null in Frontend #1

Closed
marciocamello opened this issue Jan 17, 2015 · 5 comments
Closed

Comments

@marciocamello
Copy link

/**
* Initialising front end translator.
*/
private function _initTranslation() {
$module = Yii::$app->getModule('translatemanager');

    if ($module->checkAccess() && $this->_checkRoles($module->roles)) {
        Yii::$app->session->set(Module::SESSION_KEY_ENABLE_TRANSLATE, true);
    }
}
@marciocamello
Copy link
Author

I'm using advanced application new installation

@lajax
Copy link
Owner

lajax commented Jan 17, 2015

For the translatemanager to work the config settings need to be defined in common/config/main.php (in case of yii2-advanced version). The visibility of the module can be set through user privileges (roles, allowedIPs). Unauthorised access can be prevented this way.

Thanks for the feedback.

@lajax
Copy link
Owner

lajax commented Jan 21, 2015

In order to turn on user privilege checking the authManager has to be enabled in the common config.

@lajax lajax closed this as completed Jan 26, 2015
@philippfrenzel
Copy link

got the same issue, can you pls. add it to the docs?

@lajax
Copy link
Owner

lajax commented Jan 29, 2015

Thanks for the suggestion. I added this to the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants