@@ -59,7 +59,7 @@ module.exports = class AccessUtils {
59
59
if ( typeof Model . observe === 'function' ) {
60
60
debug ( 'Attaching access observer to %s' , modelName )
61
61
Model . observe ( 'access' , ( ctx , next ) => {
62
- const currentUser = AccessUtils . getCurrentUser ( )
62
+ const currentUser = this . getCurrentUser ( )
63
63
64
64
if ( currentUser ) {
65
65
// Do not filter if options.skipAccess has been set.
@@ -198,8 +198,8 @@ module.exports = class AccessUtils {
198
198
getUserGroups ( userId , force , cb ) {
199
199
force = force || false
200
200
cb = cb || createPromiseCallback ( )
201
- const currentUser = AccessUtils . getCurrentUser ( )
202
- const currentUserGroups = AccessUtils . getCurrentUserGroups ( )
201
+ const currentUser = this . getCurrentUser ( )
202
+ const currentUserGroups = this . getCurrentUserGroups ( )
203
203
204
204
// Return from the context cache if exists.
205
205
if ( ! force && currentUser && currentUser . getId ( ) === userId ) {
@@ -228,7 +228,7 @@ module.exports = class AccessUtils {
228
228
*
229
229
* @returns {Object } Returns the currently logged in user.
230
230
*/
231
- static getCurrentUser ( ) {
231
+ getCurrentUser ( ) {
232
232
const ctx = LoopBackContext . getCurrentContext ( )
233
233
const currentUser = ( ctx && ctx . get ( 'currentUser' ) ) || null
234
234
@@ -240,7 +240,7 @@ module.exports = class AccessUtils {
240
240
*
241
241
* @returns {Array } Returnds a list of access groups the user is a member of.
242
242
*/
243
- static getCurrentUserGroups ( ) {
243
+ getCurrentUserGroups ( ) {
244
244
const ctx = LoopBackContext . getCurrentContext ( )
245
245
const currentUserGroups = ( ctx && ctx . get ( 'currentUserGroups' ) ) || [ ]
246
246
0 commit comments