@@ -75,7 +75,7 @@ module.exports = class AccessUtils {
7575 }
7676
7777 // Do not apply filters if no group access acls were applied.
78- const loopbackContext = LoopBackContext . getCurrentContext ( )
78+ const loopbackContext = LoopBackContext . getCurrentContext ( { bind : true } )
7979 const groupAccessApplied = Boolean ( loopbackContext && loopbackContext . get ( 'groupAccessApplied' ) )
8080
8181 if ( ! groupAccessApplied ) {
@@ -229,7 +229,7 @@ module.exports = class AccessUtils {
229229 * @returns {Object } Returns the currently logged in user.
230230 */
231231 getCurrentUser ( ) {
232- const ctx = LoopBackContext . getCurrentContext ( )
232+ const ctx = LoopBackContext . getCurrentContext ( { bind : true } )
233233 const currentUser = ( ctx && ctx . get ( 'currentUser' ) ) || null
234234
235235 return currentUser
@@ -241,7 +241,7 @@ module.exports = class AccessUtils {
241241 * @returns {Array } Returnds a list of access groups the user is a member of.
242242 */
243243 getCurrentUserGroups ( ) {
244- const ctx = LoopBackContext . getCurrentContext ( )
244+ const ctx = LoopBackContext . getCurrentContext ( { bind : true } )
245245 const currentUserGroups = ( ctx && ctx . get ( 'currentUserGroups' ) ) || [ ]
246246
247247 return currentUserGroups
@@ -296,7 +296,7 @@ module.exports = class AccessUtils {
296296 return cb . promise
297297 }
298298
299- LoopBackContext . getCurrentContext ( ) . set ( 'groupAccessApplied' , true )
299+ LoopBackContext . getCurrentContext ( { bind : true } ) . set ( 'groupAccessApplied' , true )
300300
301301 /**
302302 * Basic application that does not cover static methods. Similar to $owner. (RECOMMENDED)
@@ -369,7 +369,7 @@ module.exports = class AccessUtils {
369369
370370 // Note the fact that we are allowing access due to passing an ACL.
371371 if ( res ) {
372- LoopBackContext . getCurrentContext ( ) . set ( 'groupAccessApplied' , true )
372+ LoopBackContext . getCurrentContext ( { bind : true } ) . set ( 'groupAccessApplied' , true )
373373 }
374374
375375 return cb ( null , res )
0 commit comments