Moved UserPermission's hasPermission and other function to UserPermissions manager to be able to fully serialize User object.