@@ -59,7 +59,7 @@ module.exports = class AccessUtils {
5959 if ( typeof Model . observe === 'function' ) {
6060 debug ( 'Attaching access observer to %s' , modelName )
6161 Model . observe ( 'access' , ( ctx , next ) => {
62- const currentUser = AccessUtils . getCurrentUser ( )
62+ const currentUser = this . getCurrentUser ( )
6363
6464 if ( currentUser ) {
6565 // Do not filter if options.skipAccess has been set.
@@ -198,8 +198,8 @@ module.exports = class AccessUtils {
198198 getUserGroups ( userId , force , cb ) {
199199 force = force || false
200200 cb = cb || createPromiseCallback ( )
201- const currentUser = AccessUtils . getCurrentUser ( )
202- const currentUserGroups = AccessUtils . getCurrentUserGroups ( )
201+ const currentUser = this . getCurrentUser ( )
202+ const currentUserGroups = this . getCurrentUserGroups ( )
203203
204204 // Return from the context cache if exists.
205205 if ( ! force && currentUser && currentUser . getId ( ) === userId ) {
@@ -228,7 +228,7 @@ module.exports = class AccessUtils {
228228 *
229229 * @returns {Object } Returns the currently logged in user.
230230 */
231- static getCurrentUser ( ) {
231+ getCurrentUser ( ) {
232232 const ctx = LoopBackContext . getCurrentContext ( )
233233 const currentUser = ( ctx && ctx . get ( 'currentUser' ) ) || null
234234
@@ -240,7 +240,7 @@ module.exports = class AccessUtils {
240240 *
241241 * @returns {Array } Returnds a list of access groups the user is a member of.
242242 */
243- static getCurrentUserGroups ( ) {
243+ getCurrentUserGroups ( ) {
244244 const ctx = LoopBackContext . getCurrentContext ( )
245245 const currentUserGroups = ( ctx && ctx . get ( 'currentUserGroups' ) ) || [ ]
246246
0 commit comments