@@ -75,7 +75,7 @@ module.exports = class AccessUtils {
75
75
}
76
76
77
77
// Do not apply filters if no group access acls were applied.
78
- const loopbackContext = LoopBackContext . getCurrentContext ( )
78
+ const loopbackContext = LoopBackContext . getCurrentContext ( { bind : true } )
79
79
const groupAccessApplied = Boolean ( loopbackContext && loopbackContext . get ( 'groupAccessApplied' ) )
80
80
81
81
if ( ! groupAccessApplied ) {
@@ -229,7 +229,7 @@ module.exports = class AccessUtils {
229
229
* @returns {Object } Returns the currently logged in user.
230
230
*/
231
231
getCurrentUser ( ) {
232
- const ctx = LoopBackContext . getCurrentContext ( )
232
+ const ctx = LoopBackContext . getCurrentContext ( { bind : true } )
233
233
const currentUser = ( ctx && ctx . get ( 'currentUser' ) ) || null
234
234
235
235
return currentUser
@@ -241,7 +241,7 @@ module.exports = class AccessUtils {
241
241
* @returns {Array } Returnds a list of access groups the user is a member of.
242
242
*/
243
243
getCurrentUserGroups ( ) {
244
- const ctx = LoopBackContext . getCurrentContext ( )
244
+ const ctx = LoopBackContext . getCurrentContext ( { bind : true } )
245
245
const currentUserGroups = ( ctx && ctx . get ( 'currentUserGroups' ) ) || [ ]
246
246
247
247
return currentUserGroups
@@ -296,7 +296,7 @@ module.exports = class AccessUtils {
296
296
return cb . promise
297
297
}
298
298
299
- LoopBackContext . getCurrentContext ( ) . set ( 'groupAccessApplied' , true )
299
+ LoopBackContext . getCurrentContext ( { bind : true } ) . set ( 'groupAccessApplied' , true )
300
300
301
301
/**
302
302
* Basic application that does not cover static methods. Similar to $owner. (RECOMMENDED)
@@ -369,7 +369,7 @@ module.exports = class AccessUtils {
369
369
370
370
// Note the fact that we are allowing access due to passing an ACL.
371
371
if ( res ) {
372
- LoopBackContext . getCurrentContext ( ) . set ( 'groupAccessApplied' , true )
372
+ LoopBackContext . getCurrentContext ( { bind : true } ) . set ( 'groupAccessApplied' , true )
373
373
}
374
374
375
375
return cb ( null , res )
0 commit comments