util.roles: Return nil if the role has no explicit policy (fixes inheritance)
authorMatthew Wild <mwild1@gmail.com>
Fri, 07 Oct 2022 16:58:08 +0100
changeset 12750 7eabf8d78978
parent 12749 2cbf0e9314ff
child 12751 9d6d64fb7641
util.roles: Return nil if the role has no explicit policy (fixes inheritance) Previously, if the first inherited role had no opinion, it returned false and prevented further consultation of other inherited roles. This bug was found thanks to the implementation of missing test cases identified through mutation testing.
util/roles.lua
--- a/util/roles.lua	Fri Oct 07 11:35:56 2022 +0100
+++ b/util/roles.lua	Fri Oct 07 16:58:08 2022 +0100
@@ -30,7 +30,7 @@
 				end
 			end
 		end
-		return false;
+		return nil;
 	end
 end