yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Allow two chars and containing a / in the item name

Open schmunk42 opened this issue 6 years ago • 2 comments

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?

schmunk42 avatar Dec 11 '18 16:12 schmunk42

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

maxxer avatar Dec 11 '18 20:12 maxxer

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.

tonydspaniard avatar Dec 11 '18 21:12 tonydspaniard