Subversion Repositories SmartDukaan

Rev

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

Rev 2025 Rev 2358
Line 214... Line 214...
214
            reports = get_reports(role) 
214
            reports = get_reports(role) 
215
            return [to_t_report(report) for report in reports]
215
            return [to_t_report(report) for report in reports]
216
        finally:
216
        finally:
217
            close_session()
217
            close_session()
218
            
218
            
219
    def authenticateCatalogUser(self, username, password):
219
    def authenticateCatalogUser(self, username, password, role):
220
        """
220
        """
221
        Returns the CatalogDashboardUser struct associated with the given username and password if they match.
221
        Returns the CatalogDashboardUser struct associated with the given username and password if they match.
222
        Throws an exception otherwise.
222
        Throws an exception otherwise.
223
        
223
        
224
        Parameters:
224
        Parameters:
225
         - username
225
         - username
226
         - password
226
         - password
227
        """
227
        """
228
        try:
228
        try:
229
            catalog_user = CatalogDashboardUser.get_by(username=username, password=password)
229
            catalog_user = CatalogDashboardUser.get_by(username=username, password=password, role=role)
230
            return to_t_catalog_user(catalog_user)
230
            return to_t_catalog_user(catalog_user)
231
        except:
231
        except:
232
            raise HelperServiceException(101, "No such catalog user")
232
            raise HelperServiceException(101, "No such catalog user")
233
        finally:
233
        finally:
234
            close_session()         
234
            close_session()