refactored permissions and prepare to refactory user