def METHOD_NAME(
    master_api_key: "MasterAPIKey", organisation: Organisation, permission_key: str
) -> bool:
    if master_api_key.is_admin:
        return master_api_key.organisation == organisation
    return master_api_key_has_organisation_permission_using_roles(
        master_api_key, organisation, permission_key
    )