Almost done with the proyect! We only need to make K go from 1 to the maximum dangerous combination in:

findDangerousCombination(Z,L) :- permissions(Z,Y), comb(K,Y,L) , dangerousCombination(L).

Then, evaluate the last inference rule inside a loop from 1 to K and that's it!