Implemented adding User permissions, fixed reference bugs