Fixes: https://pagure.io/koji/issue/3802
rebased onto 6c091410d63139100e150ab95358a971eed94040
moving getAllPerms code into a get_all_perms function is fine, but unnecessary here.
if perm not in all_perm_ids is not the best way to do this check. The normal way would be:
if perm not in all_perm_ids
perm_id = get_perm_id(perm, strict=True)
This will conveniently allow the call to handle permissions by name as well
rebased onto 2232793fe947f4a90f91a8e971e3f49e37b9f4c9
@mikem fixed
rebased onto 53d8ef275d26c275f4935a1e8af4b2e41fa2855d
if perm: perm = get_perm_id(perm, strict=True)
I would use if perm is None, otherwise you will still hit #3802 when 0 is passed in
if perm is None
0
rebased onto 7f37450b0258cea774661b7763b52cf67b126c54
@mikem updated to if perm is not None. I guess you meant it this, because if perm is None cannot work when perm is None as default and we need to catch non existing perm ID's, not add check when perm is None as default.
if perm is not None
updated to if perm is not None
ah yes, that is what I meant, thanks!
:thumbsup:
Metadata Update from @mikem: - Pull-request tagged with: testing-ready
Metadata Update from @relias-redhat: - Pull-request tagged with: testing-done
Commit 52e19b25 fixes this pull-request
Pull-Request has been merged by tkopecek
Fixes: https://pagure.io/koji/issue/3802