Learn more about these different git repos.
Other Git URLs
Steps to Reproduce:
Run env.session.hasPerm(non-exist-perm)
Actual result:
False
Expected result:
Should return the error message.
PR #1099
Metadata Update from @julian8628: - Issue tagged with: easyfix
PR #1099 adds a strict option, which defaults to false. This is not quite the behavior asked for, because it will only raise an error if the strict option is explicitly set to true.
I'm think the solution in #1099 is the correct one. Technically, a False result for hasPerm(non-exist-perm) is correct. The user definitely does not have a perm that does not exist.
There may be code that in the wild that relies on this, perhaps implicitly. Or perhaps I'm being paranoid.
Otoh, if you feel strongly that an error should always be raised in such cases, or raised by default, then we can discuss it more.
For the one side, yes, it is correct when the result for hasPerm(non-exist-perm) is False. Yes, the user does not have a perm that does not exist. But I guess that better is that we can check that permission is exist and when not, we should return an error.
@jcupova, so are you objecting to the given solution?
Most hub calls in Koji tend to be friendly by default, and only raise errors either when strict is specified, or when there is no reasonable return value. Here there is a reasonable return value.
+1 for 'strict' solution
Also +1 for 'strict' solution
Commit b730995 fixes this issue
Metadata Update from @julian8628: - Issue set to the milestone: 1.17
Login to comment on this ticket.