Ejemplo n.º 1
0
 def post(self):
     userID = int(self.get_arg('userID', '0'))
     roleID = int(self.get_arg('roleID', '0'))
     if userID <= 0 or roleID <= 0:
         self.out_fail(code = 103004)
         return
     id = user_logic.bind_user_role(userID = userID, roleID = roleID, user = self.get_oper_user())
     if None != id and id > 0:
         self.write_oper_log(action = 'userBindRole', targetType = 1, targetID = str(userID), targetName = '', startStatus = str(userID), endStatus= str(roleID))
         self.out_ok()
     else:
         self.out_fail(code = 103005)
Ejemplo n.º 2
0
 def bind_role(self, userID, roleID, user):
     if None == roleID or '' == roleID:
         return
     id = user_logic.bind_user_role(userID=userID,
                                    roleID=roleID,
                                    user=self.get_oper_user())
     if None != id and id > 0:
         self.write_oper_log(action='userBindRole',
                             targetType=1,
                             targetID=str(userID),
                             targetName='',
                             startStatus=str(userID),
                             endStatus=str(roleID))
Ejemplo n.º 3
0
 def post(self):
     userID = int(self.get_arg('userID', '0'))
     roleID = int(self.get_arg('roleID', '0'))
     if userID <= 0 or roleID <= 0:
         self.out_fail(code=103004)
         return
     id = user_logic.bind_user_role(userID=userID,
                                    roleID=roleID,
                                    user=self.get_oper_user())
     if None != id and id > 0:
         self.write_oper_log(action='userBindRole',
                             targetType=1,
                             targetID=str(userID),
                             targetName='',
                             startStatus=str(userID),
                             endStatus=str(roleID))
         self.out_ok()
     else:
         self.out_fail(code=103005)
Ejemplo n.º 4
0
 def bind_role(self, userID, roleID, user):
     if None == roleID or '' == roleID:
         return
     id = user_logic.bind_user_role(userID = userID, roleID = roleID, user = self.get_oper_user())
     if None != id and id > 0:
         self.write_oper_log(action = 'userBindRole', targetType = 1, targetID = str(userID), targetName = '', startStatus = str(userID), endStatus= str(roleID))