Your code has a number of errors, but I think the error you are asking about is due to you having an extra set of [] around the 'systems' object (the closing one is missing in your question though.)
You also do not return anything from audit_permissions so it will return 'None' every time.