Generic restriction rule mechanism

Rule mechanism is not tight anymore to the badge system.

Rule mechanism is now usable on any entity, just need to follow some step.