What should be done so that other users who register for fronted cannot enter the backend except the admin? But could they, at the same time, create, for example, blog posts and something else on the site?
- Could you explain that in your understanding there is a frontend and backend? .. otherwise I am confused ... - Mikhail Rebrov
- look toward RBAC - Mikhail Rebrov
- The 'site' folder is divided into: 'backend' is the admin login to yii2, (admin.site.com) fronted- 'face of the site' (site.com) and 'common' also in 'vendor' the tags-module modules are connected ',' blog-module ', etc. about RBAC - it's not clear .. what should I look for and where? - Sandro_s
- rgblog.ru/page/yii2-i-rbac-kontrol-dostupa-na-osnove-rolej - Mikhail Rebrov
- I can’t write a full answer myself, because I didn’t work on the second YII, so I bless everyone who reads writing a comprehensive answer. - Mikhail Rebrov
|
1 answer
In the simplest version, make a list of users for the User model in the backend application directly in the model, as is done in the basic application: https://github.com/yiisoft/yii2-app-basic/blob/master/models/User .php
that is, for a backend application, the restriction will be only those users who are written to the static variable $users
- there is Yii2 basic after all, but I have advanced and I don’t have any models in the backend except for .gitkeep - Sandro_s
- so what, the backend application also has a model, it works with the User model, which can only have 1 account (for example, admin), which will be set up there - Maksim Fedorov
- Ie need to create such a User file in the backand / models? - Sandro_s
|