-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding same role multiple times #1941
Comments
You could use https://metacpan.org/pod/With::Roles to apply roles as it keeps track of this within its own usage. Unfortunately it's not a feature of Role::Tiny itself so it would depend on using the same Role::Tiny wrapper to apply every role. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce the behavior
This isn't a bug because it's not doing something contrary to documentation, but seems it could be an improvement.
Expected behavior
I would think it would be ideal for
with_roles
to detect the role has already been added and skip it.Actual behavior
Currently
with_roles
adds the role even though it's already been added.Furthermore, using the shortcut is even more bizarre:
The text was updated successfully, but these errors were encountered: