Fixed wrong calls to has_all_permissions method and missing imports