1- import { EntitlementReasons , IsEntitledResult } from './types' ;
1+ import { EntitlementJustifications , IsEntitledResult } from './types' ;
22import { IEntityWithRoles , Permission , TEntity , tokenTypes , TUserEntity } from '../identity/types' ;
33import { EntitlementsCache , NO_EXPIRE } from './storage/types' ;
44import { pickExpTimestamp } from './storage/exp-time.utils' ;
@@ -48,7 +48,7 @@ export class EntitlementsUserScoped<T extends TEntity = TEntity> {
4848 if ( expTime === undefined ) {
4949 return {
5050 result : false ,
51- reason : EntitlementReasons . MISSING_FEATURE ,
51+ justification : EntitlementJustifications . MISSING_FEATURE ,
5252 } ;
5353 } else if ( expTime === NO_EXPIRE || expTime > new Date ( ) . getTime ( ) ) {
5454 return {
@@ -57,7 +57,7 @@ export class EntitlementsUserScoped<T extends TEntity = TEntity> {
5757 } else {
5858 return {
5959 result : false ,
60- reason : EntitlementReasons . BUNDLE_EXPIRED ,
60+ justification : EntitlementJustifications . BUNDLE_EXPIRED ,
6161 } ;
6262 }
6363 }
@@ -66,7 +66,7 @@ export class EntitlementsUserScoped<T extends TEntity = TEntity> {
6666 if ( this . permissions === undefined || this . permissions . indexOf ( permissionKey ) < 0 ) {
6767 return {
6868 result : false ,
69- reason : EntitlementReasons . MISSING_PERMISSION ,
69+ justification : EntitlementJustifications . MISSING_PERMISSION ,
7070 } ;
7171 }
7272
@@ -84,14 +84,14 @@ export class EntitlementsUserScoped<T extends TEntity = TEntity> {
8484 return {
8585 result : true ,
8686 } ;
87- } else if ( isEntitledToFeatureResult . reason === EntitlementReasons . BUNDLE_EXPIRED ) {
87+ } else if ( isEntitledToFeatureResult . justification === EntitlementJustifications . BUNDLE_EXPIRED ) {
8888 hasExpired = true ;
8989 }
9090 }
9191
9292 return {
9393 result : false ,
94- reason : hasExpired ? EntitlementReasons . BUNDLE_EXPIRED : EntitlementReasons . MISSING_FEATURE ,
94+ justification : hasExpired ? EntitlementJustifications . BUNDLE_EXPIRED : EntitlementJustifications . MISSING_FEATURE ,
9595 } ;
9696 }
9797
0 commit comments