Exemple #1
0
 def run(self, serverState, request, response):
     target_str=request.getParam('user')
     userhandler = UserHandler()
     target_user_obj=userhandler.getUserFromString(target_str)
     if target_user_obj is None:
         raise ServerCommandError("User %s doesn't exist"%target_str)
     userhandler.deleteUser(target_user_obj)
     response.add('Deleted user %s'%target_str)
Exemple #2
0
 def run(self, serverState, request, response):
     target_str = request.getParam('user')
     userhandler = UserHandler()
     target_user_obj = userhandler.getUserFromString(target_str)
     if target_user_obj is None:
         raise ServerCommandError("User %s doesn't exist" % target_str)
     userhandler.deleteUser(target_user_obj)
     response.add('Deleted user %s' % target_str)
Exemple #3
0
 def run(self, serverState, request, response):
     user=request.getParam('user')
     userhandler = UserHandler()
     try:
         user_obj = userhandler.getUserFromString(user)
         user_obj.demote()
         response.add('Demoted user %s to level %s'%(
             user, user_obj.getUserlevelAsString()))
     except UserError as e:
         raise cpc.util.CpcError("Error demoting user: %s"%str(e))
Exemple #4
0
 def run(self, serverState, request, response):
     user = request.getParam('user')
     userhandler = UserHandler()
     try:
         user_obj = userhandler.getUserFromString(user)
         user_obj.demote()
         response.add('Demoted user %s to level %s' %
                      (user, user_obj.getUserlevelAsString()))
     except UserError as e:
         raise cpc.util.CpcError("Error demoting user: %s" % str(e))
Exemple #5
0
 def run(self, serverState, request, response):
     name=request.getParam('name')
     prj=self.getProject(request, serverState)
     prjName=prj.getName()
     usrhandler = UserHandler()
     target_user=usrhandler.getUserFromString(name)
     if target_user is None:
         raise ProjectServerCommandException("User %s doesn't exist"%name)
     usrhandler.addUserToProject(target_user, prjName)
     response.add("Granted access to user %s on project %s"%(name, prjName))
     log.info("Granted access to %s on project %s"%(name, prjName))
Exemple #6
0
 def run(self, serverState, request, response):
     name = request.getParam('name')
     prj = self.getProject(request, serverState)
     prjName = prj.getName()
     usrhandler = UserHandler()
     target_user = usrhandler.getUserFromString(name)
     if target_user is None:
         raise ProjectServerCommandException("User %s doesn't exist" % name)
     usrhandler.addUserToProject(target_user, prjName)
     response.add("Granted access to user %s on project %s" %
                  (name, prjName))
     log.info("Granted access to %s on project %s" % (name, prjName))