Subversion Repositories SmartDukaan

Rev

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

Rev 6322 Rev 6788
Line 222... Line 222...
222
            reports = get_reports(role) 
222
            reports = get_reports(role) 
223
            return [to_t_report(report) for report in reports]
223
            return [to_t_report(report) for report in reports]
224
        finally:
224
        finally:
225
            close_session()
225
            close_session()
226
            
226
            
227
    def authenticateCatalogUser(self, username, password, role):
227
    def authenticateCatalogUser(self, username, password):
228
        """
228
        """
229
        Returns the CatalogDashboardUser struct associated with the given username and password if they match.
229
        Returns the CatalogDashboardUser struct associated with the given username and password if they match.
230
        Throws an exception otherwise.
230
        Throws an exception otherwise.
231
        
231
        
232
        Parameters:
232
        Parameters:
233
         - username
233
         - username
234
         - password
234
         - password
235
        """
235
        """
236
        try:
236
        try:
237
            catalog_user = CatalogDashboardUser.get_by(username=username, password=password, role=role)
237
            catalog_user = CatalogDashboardUser.get_by(username=username, password=password)
238
            return to_t_catalog_user(catalog_user)
238
            return to_t_catalog_user(catalog_user)
239
        except:
239
        except:
240
            raise HelperServiceException(101, "No such catalog user")
240
            raise HelperServiceException(101, "No such catalog user")
241
        finally:
241
        finally:
242
            close_session()
242
            close_session()