#386 Corrected Foreign key to entity for user permission