Yii 2.0 Part 8 - Role-based Access Control (rbac)

preview_player
Показать описание
This video looks at the default access control mechanism in Yii 2.0 (Access Control Lists) and how this is very limited and not very useful for a production site that has more than a few users. We discuss the concepts of role-based access control and what some example hierarchies look like and then show how this is enabled by adding a database migration and the use of an rbac admin extension. We then look at how we check permissions in code and how we can use the routes restriction provided by the plugin to more easily control permissions.

Рекомендации по теме
Комментарии
Автор

I have searching for RBAC in Yii. I found your video and watch it. You have clearly explains the concept. Very Good.

seniordeveloper
Автор

I clearly beginning understand the RBAC concept and what i see now is when we planning implement RBAC module we need think twice how to implement permissions for users with specify to controllers action. Good job Luke i agree with others, keep doing it. I mean by this - more tutorials for yii 2 (API Facebook, twitter, payments etc.) you are a good teacher with really clear english that even i can understood :) Thank you a lot ! Greetings from Poland !

escreamy
Автор

Good vid. Finally got it working! :)

Routes are great in conjunction with the menus - saves hours!

Incidentally you can make the RBAC admin a bit easier by adding a "layout" option under the /modules/admin section in your main config file. This at least gives you a top/left or right menu to jump between the admin screens ;)

 'modules' => [
        'admin' => [
            'class' => 'mdm\admin\Module',
            'layout' => 'top-menu', // just add this to enable a menu inside the admin
        ]
    ],

bjclark
Автор

Thanks ! Excellent explanation of rbac. You should do more Yii2 tutorial.

fuadallahverdi
Автор

A very nice video, clearly explained and informative. Thanks a lot, and please don't stop posting videos. By the way, are you in the Yii dev team or something? Seems like you know the framework with quite high detail level.

ehguacho
Автор

Such an amazing teacher, wonder if you are plaing to create Yii2 screen cast series. I am sure to opt-in :D !

luxlyny
Автор

could I add display column for permissions? instead of showing original permission name just I need to show display column in the assignment section. is it possible?

naseerwahab
Автор

installation of yii2-admin plugin did not work for me although i did exactly what all available documentation says, but the rest of this video is very useful and the admin plugin is not really necessary.

alpw
Автор

anyone can help me? how to login to specified user and loads it data, ,
like login in library management system and iogin as 'me' and it only show all data bout 'me'

casul-
Автор

Hi, I getting some problem with the yii framework.
I am trying to make a sample message board with yii2.
and I make the model and the controller by gii.

and the Author name comes out on the form, i knew it because we got it in the table.
but im trying to make the web site get the author be user who login.
so i remove the field in view, then i think i have to add some to get the author in the function actionCreate(), like $model->author_name = .... something, but i dont know how to get it, can you please help me?

alextsai
Автор

Great video Luke, it explained a lot. I was wondering, how would you approach routes definitions for advanced theme where frontend and backend are separated?
Because then in database routes would be, f.eks. "/*" but would not that mean that user could then see the admin, as he has /* route?
Thanks

dakipro
Автор

Hello Luke, after installing and configuring the plugin I am getting the following error

PHP Fatal error: Call to a member function getRoles() on null in on line 62

The only page that is not bringing the error is index.php?r=admin.

Any ideas?
Thanks.

karmirArev
Автор

Hi Luke, thanks for the video. One small note: at 16:27 you mention safeUp to use transactions. But MySQL DDL statements like create table cause an implicit commit.
Therefore there is, in this case, no advantage to use safeUp.

theduke
Автор

Hi Thanks for the video, very well presented and informative. 

neilread
Автор

My yii2-admin is not populating routes.

shubhamagrawal
Автор

Luke, please create rbac with updateOwnPost permission. Thank you.

kongoon
Автор

"How this is very limited and not very useful for a production site that has more than a few users"
Is it risky using this module in large scale application or where the users are in thousands ?
Will it effect on performance or security aspects of the application ?

rajeshnk
Автор

Thanks a lot for a very good Tutorial.
I ran composer update after adding "mdmsoft/yii2-admin": "*" to composer.json and it takes hours!! :-(

ilovebreslev
Автор

It's very grate video. but any words about Rules? 

gentlice