Subversion Repositories SmartDukaan

Rev

Rev 2025 | Rev 2447 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2025 Rev 2358
Line 169... Line 169...
169
    Parameters:
169
    Parameters:
170
     - role
170
     - role
171
    """
171
    """
172
    pass
172
    pass
173
 
173
 
174
  def authenticateCatalogUser(self, username, password):
174
  def authenticateCatalogUser(self, username, password, role):
175
    """
175
    """
176
    Returns the CatalogDashboardUser struct associated with the given username and password if they match.
176
    Returns the CatalogDashboardUser struct associated with the given username, password and role if they match.
177
    Throws an exception otherwise.
177
    Throws an exception otherwise.
178
    
178
    
179
    Parameters:
179
    Parameters:
180
     - username
180
     - username
181
     - password
181
     - password
-
 
182
     - role
182
    """
183
    """
183
    pass
184
    pass
184
 
185
 
185
 
186
 
186
class Client(Iface):
187
class Client(Iface):
Line 789... Line 790...
789
    self._iprot.readMessageEnd()
790
    self._iprot.readMessageEnd()
790
    if result.success != None:
791
    if result.success != None:
791
      return result.success
792
      return result.success
792
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getReports failed: unknown result");
793
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getReports failed: unknown result");
793
 
794
 
794
  def authenticateCatalogUser(self, username, password):
795
  def authenticateCatalogUser(self, username, password, role):
795
    """
796
    """
796
    Returns the CatalogDashboardUser struct associated with the given username and password if they match.
797
    Returns the CatalogDashboardUser struct associated with the given username, password and role if they match.
797
    Throws an exception otherwise.
798
    Throws an exception otherwise.
798
    
799
    
799
    Parameters:
800
    Parameters:
800
     - username
801
     - username
801
     - password
802
     - password
-
 
803
     - role
802
    """
804
    """
803
    self.send_authenticateCatalogUser(username, password)
805
    self.send_authenticateCatalogUser(username, password, role)
804
    return self.recv_authenticateCatalogUser()
806
    return self.recv_authenticateCatalogUser()
805
 
807
 
806
  def send_authenticateCatalogUser(self, username, password):
808
  def send_authenticateCatalogUser(self, username, password, role):
807
    self._oprot.writeMessageBegin('authenticateCatalogUser', TMessageType.CALL, self._seqid)
809
    self._oprot.writeMessageBegin('authenticateCatalogUser', TMessageType.CALL, self._seqid)
808
    args = authenticateCatalogUser_args()
810
    args = authenticateCatalogUser_args()
809
    args.username = username
811
    args.username = username
810
    args.password = password
812
    args.password = password
-
 
813
    args.role = role
811
    args.write(self._oprot)
814
    args.write(self._oprot)
812
    self._oprot.writeMessageEnd()
815
    self._oprot.writeMessageEnd()
813
    self._oprot.trans.flush()
816
    self._oprot.trans.flush()
814
 
817
 
815
  def recv_authenticateCatalogUser(self, ):
818
  def recv_authenticateCatalogUser(self, ):
Line 1118... Line 1121...
1118
    args = authenticateCatalogUser_args()
1121
    args = authenticateCatalogUser_args()
1119
    args.read(iprot)
1122
    args.read(iprot)
1120
    iprot.readMessageEnd()
1123
    iprot.readMessageEnd()
1121
    result = authenticateCatalogUser_result()
1124
    result = authenticateCatalogUser_result()
1122
    try:
1125
    try:
1123
      result.success = self._handler.authenticateCatalogUser(args.username, args.password)
1126
      result.success = self._handler.authenticateCatalogUser(args.username, args.password, args.role)
1124
    except HelperServiceException, hse:
1127
    except HelperServiceException, hse:
1125
      result.hse = hse
1128
      result.hse = hse
1126
    oprot.writeMessageBegin("authenticateCatalogUser", TMessageType.REPLY, seqid)
1129
    oprot.writeMessageBegin("authenticateCatalogUser", TMessageType.REPLY, seqid)
1127
    result.write(oprot)
1130
    result.write(oprot)
1128
    oprot.writeMessageEnd()
1131
    oprot.writeMessageEnd()
Line 3455... Line 3458...
3455
class authenticateCatalogUser_args:
3458
class authenticateCatalogUser_args:
3456
  """
3459
  """
3457
  Attributes:
3460
  Attributes:
3458
   - username
3461
   - username
3459
   - password
3462
   - password
-
 
3463
   - role
3460
  """
3464
  """
3461
 
3465
 
3462
  thrift_spec = (
3466
  thrift_spec = (
3463
    None, # 0
3467
    None, # 0
3464
    (1, TType.STRING, 'username', None, None, ), # 1
3468
    (1, TType.STRING, 'username', None, None, ), # 1
3465
    (2, TType.STRING, 'password', None, None, ), # 2
3469
    (2, TType.STRING, 'password', None, None, ), # 2
-
 
3470
    (3, TType.I64, 'role', None, None, ), # 3
3466
  )
3471
  )
3467
 
3472
 
3468
  def __init__(self, username=None, password=None,):
3473
  def __init__(self, username=None, password=None, role=None,):
3469
    self.username = username
3474
    self.username = username
3470
    self.password = password
3475
    self.password = password
-
 
3476
    self.role = role
3471
 
3477
 
3472
  def read(self, iprot):
3478
  def read(self, iprot):
3473
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3479
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3474
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3480
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3475
      return
3481
      return
Line 3486... Line 3492...
3486
      elif fid == 2:
3492
      elif fid == 2:
3487
        if ftype == TType.STRING:
3493
        if ftype == TType.STRING:
3488
          self.password = iprot.readString();
3494
          self.password = iprot.readString();
3489
        else:
3495
        else:
3490
          iprot.skip(ftype)
3496
          iprot.skip(ftype)
-
 
3497
      elif fid == 3:
-
 
3498
        if ftype == TType.I64:
-
 
3499
          self.role = iprot.readI64();
-
 
3500
        else:
-
 
3501
          iprot.skip(ftype)
3491
      else:
3502
      else:
3492
        iprot.skip(ftype)
3503
        iprot.skip(ftype)
3493
      iprot.readFieldEnd()
3504
      iprot.readFieldEnd()
3494
    iprot.readStructEnd()
3505
    iprot.readStructEnd()
3495
 
3506
 
Line 3504... Line 3515...
3504
      oprot.writeFieldEnd()
3515
      oprot.writeFieldEnd()
3505
    if self.password != None:
3516
    if self.password != None:
3506
      oprot.writeFieldBegin('password', TType.STRING, 2)
3517
      oprot.writeFieldBegin('password', TType.STRING, 2)
3507
      oprot.writeString(self.password)
3518
      oprot.writeString(self.password)
3508
      oprot.writeFieldEnd()
3519
      oprot.writeFieldEnd()
-
 
3520
    if self.role != None:
-
 
3521
      oprot.writeFieldBegin('role', TType.I64, 3)
-
 
3522
      oprot.writeI64(self.role)
-
 
3523
      oprot.writeFieldEnd()
3509
    oprot.writeFieldStop()
3524
    oprot.writeFieldStop()
3510
    oprot.writeStructEnd()
3525
    oprot.writeStructEnd()
3511
 
3526
 
3512
  def __repr__(self):
3527
  def __repr__(self):
3513
    L = ['%s=%r' % (key, value)
3528
    L = ['%s=%r' % (key, value)