yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.91k forks source link

Implement PhpAuthManager #3075

Closed mitalcoi closed 10 years ago

mitalcoi commented 10 years ago

As i can see, PhpAuthManager was removed.Does this means that now rules should only be in the database?

samdark commented 10 years ago

RBAC was re-implemented. It was Microsoft-like implementation and now it's closer to NIST. There was no time to get PHP manager done for beta so old incompatible one was removed.

samdark commented 10 years ago

It will be back before RC. Different API though.

mitalcoi commented 10 years ago

if i just move old folder "rbac" to framework dir, will it work like earlier?

samdark commented 10 years ago

Try it.

gimox commented 10 years ago

i'm in a big trouble.... we are building an app with yii2 using phpManager, now what can we do? please re add the class!!!!

qiangxue commented 10 years ago

Try to create one and submit a PR? :)

cebe commented 10 years ago

@gimox you can copy the old class from git history and add it to your project if needed. Or implement it yourself and send a PR :)

gimox commented 10 years ago

i have no time to create a new one now, i try to use the old.. after a reallineament to new code (checkaccess to can) we can evaluate to

thanks

gimox commented 10 years ago

Old phpManager can not work with new code.. Anyone can add documentation for Db implementation?

Sammaye commented 10 years ago

Just look to: https://github.com/yiisoft/yii2/blob/master/framework/rbac/BaseManager.php and implement its functions.

I will be making one in a min most likely because I can't upgrade to Yii2 Beta without it either.

gimox commented 10 years ago

have you add a new Manager with baseManager function?

Sammaye commented 10 years ago

Not yet, I have a couple of other things to do first, Yii2 team might get round to it before me frankly.

On 14 April 2014 15:13, gimox notifications@github.com wrote:

have you add a new Manager with baseManager function?

— Reply to this email directly or view it on GitHubhttps://github.com/yiisoft/yii2/issues/3075#issuecomment-40369783 .

gimox commented 10 years ago

i think is not so simple..

Sammaye commented 10 years ago

I have taken a brief look at the old one compared to the new API and I reckon I could match them up and add what's needed, as I said, if I am first in line to try then I will but got a couple of things to do first.

gimox commented 10 years ago

wait for db auth doc.

gimox commented 10 years ago

my patch for now is to copy old rbac dir from old yii\rbac\ add it to app\components\rbac

point all to components\rbac.. now it work

it's a very bad solution but it work for now, after i create my own solution...

i'm very angry about this RBAC last time change...

Sammaye commented 10 years ago

It was done before Beta, what did you expect?

You was warned multiple times, no point in getting angry, maybe it could have been made that bth db and php only based auth could have been written to new API before Beta even if it meant pushing Beta forward but still...

gimox commented 10 years ago

so auth are the only think very stable and usefull, there are no sense to change it now, there are other important thinks to do before.. So they do well what expected... and yes, can be better... but i think it can be left here since all rbac are refactored, now the beta is gone and authorization is not working, not sense, let it the working version, when new is ready replace it...

gimox commented 10 years ago

so we are the few people that use yii2 since first code on git, and contribute to grow comunity and better code, sometime push code, sometime ask for code, but we are at the first line, we have test evrythink, auth, caching, object, assets, all db from mysql to oracle. We change code evrythink somethink change and try it the new code, but please not remove big function as rbac this is discouraging.

Sammaye commented 10 years ago

That's all part of being bleeding edge.

On 14 April 2014 16:05, gimox notifications@github.com wrote:

so we are the few people that use yii2 since first code on git, and contribute to grow comunity and better code, sometime push code, sometime ask for code, but we are at the first line, we have test evrythink, auth, caching, object, assets, all db from mysql to oracle. We change code evrythink somethink change and try it the new code, but please not delete function...

— Reply to this email directly or view it on GitHubhttps://github.com/yiisoft/yii2/issues/3075#issuecomment-40376043 .

gimox commented 10 years ago

yes you right.

samdark commented 10 years ago

Sorry about this last minute change. After beta nothing like that is planned.

tof06 commented 10 years ago

Just for information, I have almost finished a complete PhpManager. Just a few methods to implement, and some unit tests to write (or at least, restore/update the tests that exists before beta) I think I will be able to make a PR this afternoon or maybe tomorrow (France time).

Sammaye commented 10 years ago

Aweosme sauce, I still have not had a chance to move onto this yet so I'll wait for your PR

On 15 April 2014 11:41, Christophe BOULAIN notifications@github.com wrote:

Just for information, I have almost finished a complete PhpManager. Just a few methods to implement, and some unit tests to write (or at least, restore/update the tests that exists before beta) I think I will be able to make a PR this afternoon or maybe tomorrow (France time).

— Reply to this email directly or view it on GitHubhttps://github.com/yiisoft/yii2/issues/3075#issuecomment-40467817 .

gimox commented 10 years ago

waiting for your PR, so you can create a gist..