예제 #1
0
 def service_delUser(self, context, username):
     username = getUsername(username)
     if self.auth.delUser(username):
         self.info(context, "User %s deleted" % username)
         yield self.modified()
         returnValue(True)
     returnValue(False)
예제 #2
0
 def service_addUser(self, context, username, method, password, groups):
     username = getUsername(username)
     password = getPassword(password)
     groups = getList(getGroup, groups)
     #method is checked in auth_basemethods.AbstractAuth.hash_password
     if self.auth.addUser(username, method, password, groups):
         self.info(context, "User %s added" % username)
         yield self.modified()
         returnValue(True)
     returnValue(False)
예제 #3
0
 def service_editUser(self, context, username, method, password, groups):
     """
     Edit a user account.
     password is optional
     """
     username = getUsername(username)
     password = getPassword(password, False)
     groups = getList(getGroup, groups)
     #method is checked in auth_basemethods.AbstractAuth.hash_password
     if self.auth.editUser(username, method, password, groups):
         self.info(context, "User %s modified" % username)
         yield self.modified()
         returnValue(True)
     returnValue(False)
예제 #4
0
 def service_getUser(self, context, username):
     username = getUsername(username)
     return self.auth.getUser(username)