@@ -28,7 +28,7 @@ module.exports = class AccessUtils {
28
28
29
29
// Validate the format of options.groupRoles ($group:[role]).
30
30
this . options . groupRoles . forEach ( name => {
31
- if ( ! AccessUtils . isValidPrincipalId ( name ) ) {
31
+ if ( ! this . isValidPrincipalId ( name ) ) {
32
32
throw new Error ( '$name is an invalid access group name.' )
33
33
}
34
34
} )
@@ -253,7 +253,7 @@ module.exports = class AccessUtils {
253
253
* @param {String } principalId A principalId.
254
254
* @returns {Boolean } Returns true if the principalId is on the expected format.
255
255
*/
256
- static isValidPrincipalId ( principalId ) {
256
+ isValidPrincipalId ( principalId ) {
257
257
return Boolean ( this . extractRoleName ( principalId ) )
258
258
}
259
259
@@ -263,7 +263,7 @@ module.exports = class AccessUtils {
263
263
* @param {String } principalId A principalId.
264
264
* @returns {Boolean } Returns true if the principalId is on the expected format.
265
265
*/
266
- static extractRoleName ( principalId ) {
266
+ extractRoleName ( principalId ) {
267
267
return principalId . split ( ':' ) [ 1 ]
268
268
}
269
269
@@ -281,7 +281,7 @@ module.exports = class AccessUtils {
281
281
const modelClass = context . model
282
282
const { modelId } = context
283
283
const userId = context . getUserId ( )
284
- const roleName = AccessUtils . extractRoleName ( role )
284
+ const roleName = this . extractRoleName ( role )
285
285
const GroupAccess = this . app . models [ this . options . groupAccessModel ]
286
286
const scope = { }
287
287
0 commit comments