@ -844,15 +844,15 @@ export class GranularAccess {
} else {
// Look up user information in database.
if ( ! this . _homeDbManager ) { throw new Error ( 'database required' ) ; }
const u ser = linkParameters . aclAsUserId ?
const dbU ser = linkParameters . aclAsUserId ?
( await this . _homeDbManager . getUser ( integerParam ( linkParameters . aclAsUserId ) ) ) :
( await this . _homeDbManager . getUserByLogin ( linkParameters . aclAsUser ) ) ;
const docAuth = u ser && await this . _homeDbManager . getDocAuthCached ( {
const docAuth = dbU ser && await this . _homeDbManager . getDocAuthCached ( {
urlId : this._docId ,
userId : u ser.id
userId : dbU ser.id
} ) ;
access = docAuth ? . access || null ;
fullUser = u ser && this . _homeDbManager . makeFullUser ( u ser) || null ;
fullUser = dbU ser && this . _homeDbManager . makeFullUser ( dbU ser) || null ;
attrs . override = { access , user : fullUser } ;
}
} else {
@ -1195,7 +1195,7 @@ function getAccessForActionType(a: DocAction): AccessFn {
function denyIsFatal ( fn : AccessFn ) : AccessFn {
return ( ps ) = > {
const result = fn ( ps ) ;
if ( result === 'deny' ) { throw new Error ( 'access denied ') ; }
if ( result === 'deny' ) { throw new ErrorWithCode ( 'ACL_DENY' , 'Blocked by access rules ') ; }
return result ;
} ;
}