apply very primitiv right management, need to be refactored, I'm in a hurry