@@ -60,7 +60,6 @@ describe('a permission-set assignment grants only inside its validity window (AD
6060 let stack : VerifyStack ;
6161 let ql : any ;
6262 let adminTok : string ;
63- let setId : string ;
6463 const tok : Record < string , string > = { } ;
6564 const uid : Record < string , string > = { } ;
6665
@@ -72,7 +71,7 @@ describe('a permission-set assignment grants only inside its validity window (AD
7271 expect ( uid [ who ] , `${ who } signed up` ) . toBeTruthy ( ) ;
7372 } ;
7473 const grant = async ( who : string , window : { valid_from ?: string ; valid_until ?: string } = { } ) => {
75- await ql . insert ( GRANTS , { user_id : uid [ who ] , permission_set_id : setId , ...window } , { context : SYS } ) ;
74+ await ql . insert ( GRANTS , { user_id : uid [ who ] , permission_set : SET , ...window } , { context : SYS } ) ;
7675 } ;
7776 const door = async ( who : string ) => ( await stack . apiAs ( tok [ who ] , 'GET' , `${ DOOR } ?$top=1` ) ) . status ;
7877
@@ -83,7 +82,6 @@ describe('a permission-set assignment grants only inside its validity window (AD
8382
8483 const set = await ql . findOne ( 'sys_permission_set' , { where : { name : SET } , context : SYS } ) ;
8584 expect ( set ?. id , `the showcase seeded ${ SET } ` ) . toBeTruthy ( ) ;
86- setId = String ( set . id ) ;
8785
8886 for ( const who of [ 'bare' , 'open' , 'before' , 'inside' , 'after' , 'edited' , 'falls' , 'rises' ] ) await sign ( who ) ;
8987 const now = Date . now ( ) ;
@@ -172,7 +170,7 @@ describe('a permission-set assignment grants only inside its validity window (AD
172170
173171 const at = Date . now ( ) + DAY ;
174172 const res = await stack . apiAs ( adminTok , 'POST' , `/data/${ GRANTS } ` , {
175- user_id : uid . bare , permission_set_id : setId , valid_from : iso ( at ) , valid_until : iso ( at - HOUR ) ,
173+ user_id : uid . bare , permission_set : SET , valid_from : iso ( at ) , valid_until : iso ( at - HOUR ) ,
176174 } ) ;
177175 const body = ( await res . json ( ) ) as any ;
178176 expect ( [ res . status , body ?. code ] ) . toEqual ( [ 400 , 'VALIDATION_FAILED' ] ) ;
0 commit comments