fix(subscriptions): added stream deleted subscription

This commit is contained in:
Dimitrie Stefanescu
2020-09-01 10:58:29 +01:00
parent 1b57a2ba4b
commit 11571a1d76
5 changed files with 197 additions and 134 deletions
+2 -2
View File
@@ -129,14 +129,14 @@ async function authorizeResolver( userId, resourceId, requiredRole ) {
let userAclEntry = await knex( role.aclTableName ).select( '*' ).where( { resourceId: resourceId, userId: userId } ).first( )
if ( !userAclEntry ) throw new ForbiddenError( 'You are not authorized' )
if ( !userAclEntry ) throw new ForbiddenError( 'You do not have access to this resource.' )
userAclEntry.role = roles.find( r => r.name === userAclEntry.role )
if ( userAclEntry.role.weight >= role.weight )
return userAclEntry.role.name
else
throw new ForbiddenError( 'You are not authorized' )
throw new ForbiddenError( 'You are not authorized.' )
}
module.exports = {