2amigos / yii2-usuario

Highly customizable and extensible user management, authentication, and authorization Yii2 extension
https://github.com/2amigos/yii2-usuario
Other
292 stars 141 forks source link

Allow two chars and containing a / in the item name #297

Open schmunk42 opened 5 years ago

schmunk42 commented 5 years ago

What steps will reproduce the problem?

Try to use za or some/route/permissions as Permission name.

What is the expected result?

To be able to save the data.

What do you get instead?

A validation error.

Would be like this I think:

['name', 'match', 'pattern' => '/^[\w][\w-.:\/]?[\w]$/'],

here https://github.com/2amigos/yii2-usuario/blob/5de9e6470b41bd50011913ce38bd24f45e13d829/src/User/Model/AbstractAuthItem.php#L101

Can I create a PR for this or are there objections about it?

maxxer commented 5 years ago

I've no objections in allowing /, but the proposed regexp doesn't seem to accept more than two characters for permission name.

Anyway go with the PR once fixed. thanks

tonydspaniard commented 5 years ago

So sorry I don't have time guys. Lately crypto projects take so much time for me. Thanks again for your work. Highly and very much appreciated.