@@ -343,6 +343,12 @@ class ChangeRequestDB {
343343 return userDatabase . getVersionDiff ( originalBranch , trackingBranch , undefined , options )
344344 }
345345
346+ checkUserReadAuthorization ( ) {
347+ const tmpClient = this . connectWithCurrentUser ( )
348+ const query = TerminusClient . WOQL . limit ( 1 ) . triple ( 'v:a' , 'v:b' , 'v:c' )
349+ return tmpClient . query ( query )
350+ }
351+
346352 async addMessage ( changeIdHash :string , message :string ) {
347353 const changeId = `ChangeRequest/${ changeIdHash } `
348354 const requestDoc = await this . client . getDocument ( { id : changeId } )
@@ -456,14 +462,15 @@ class ChangeRequestDB {
456462 }
457463 }
458464
459- async getLastCommitsIndexed ( limit = 1 , status ?:string ) {
465+ async getLastCommitsIndexed ( limit = 1 , status ?:string , branch ?: string ) {
460466 try {
461467 const WOQL = TerminusClient . WOQL
462468 const statusVar = status && this . availableStatus [ status ] ? `@schema:Indexing_Status/${ status } ` : 'v:indexing_status'
469+ const branchVar = branch ? WOQL . string ( branch ) : 'v:branch'
463470 const query = WOQL . limit ( limit ) . order_by ( [ 'v:time' , 'desc' ] ) . and (
464471 WOQL . triple ( 'v:index' , 'rdf:type' , '@schema:Indexed_commit' ) ,
465472 WOQL . triple ( 'v:index' , '@schema:change_request_commit_id' , 'v:commit_id' ) ,
466- WOQL . triple ( 'v:index' , '@schema:searchable_branch_name' , 'v:branch' ) ,
473+ WOQL . triple ( 'v:index' , '@schema:searchable_branch_name' , branchVar ) ,
467474 WOQL . triple ( 'v:index' , '@schema:indexing_status' , statusVar ) ,
468475 WOQL . triple ( 'v:index' , '@schema:searchable_branch_commit_id' , 'v:searchable_commit' ) ,
469476 WOQL . triple ( 'v:index' , '@schema:indexed_at' , 'v:time' ) ,
0 commit comments