It might be true. Unfortunately some men are very controlling and needs to have rules for their girlfriend how to interact with men.
To me it is a serious sign of an abusive boyfriend, and I would look that girl seriously in her eyes and say get out of it ASAP.
On the other hand, if a girl is very flirtatious with men, it might be that she feels she needs to distance herself from other men by not interacting with them. Mainly because she is aware of her own weakness. She might say a thing like that because she loves her boyfriend so much she wouldn't hurt him. Maybe she also finds you attractive and needs to distance herself because of that.