-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Moved authManager from base to web application #1192
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
Conversation
… in apps other than web and can be set in config if needed
|
Disagreed. // Some cron script:
$users = User::find()->all();
foreach ($users as $user) {
if (Yii::$app->authManager->checkAccess($user->id, 'adminNotification')) {
Yii::$app->mail->... ->send();
}
} |
|
Am... if count users over 9000? superfast realization... Sorry for my english |
Need to use DataProvider with pagination then. This is a concept example after all.
I can tell same thing about almost any application component. Following this philosophy we should remove “authManager” even from yii\web\Application, because it could be a web application, which will not use RBAC. RBAC is not web-specific feature – it is a basic thing, which can be used anywhere, so it should be kept in the base application. |
|
Yes, it can be used in console but it's rare in practice. Nothing prevents you from adding it later via config. |
|
Following your logic, anything can be used anywhere.
Basic application can not exist without RBAC? seriously? |
|
I think it should remain in base application. It's like |
|
Makes sense. |
|
If you add this method to \yii\web\Application and \yii\console\Application and remove from \yii\base\application? |
|
@ponikrf it would be duplicating code that can be done in one place. so not a good solution. |
It's rarely used in apps other than web and can be set in config if needed.