added more entity file access control