@@ -127,7 +127,7 @@ public static class ErrorMessages
127
127
internal const string ExceededServiceStackOperations = "The free-quota limit on '{0} ServiceStack Operations' has been reached." + UpgradeInstructions ;
128
128
internal const string ExceededAdminUi = "The Admin UI is a commerical-only premium feature." + UpgradeInstructions ;
129
129
internal const string ExceededPremiumFeature = "Unauthorized use of a commerical-only premium feature." + UpgradeInstructions ;
130
- public const string UnauthorizedAccessRequest = "Unauthorized access request of a licensed feature." + UpgradeInstructions ;
130
+ public const string UnauthorizedAccessRequest = "Unauthorized access request of a licensed feature." ;
131
131
}
132
132
133
133
public static class FreeQuotas
@@ -384,10 +384,22 @@ public static IDisposable RequestAccess(object accessToken, LicenseFeature srcFe
384
384
{
385
385
var accessType = accessToken . GetType ( ) ;
386
386
387
- if ( srcFeature != LicenseFeature . Client || requestedAccess != LicenseFeature . Text
388
- || accessToken == null || ! _approved . __tokens . Contains ( accessType . FullName ) )
387
+ if ( srcFeature != LicenseFeature . Client || requestedAccess != LicenseFeature . Text || accessToken == null )
389
388
throw new LicenseException ( ErrorMessages . UnauthorizedAccessRequest ) ;
390
389
390
+ if ( accessType . Name . StartsWith ( "#" ) ) //Smart Assembly
391
+ return new AccessToken ( requestedAccess ) ;
392
+
393
+ if ( ! _approved . __tokens . Contains ( accessType . FullName ) )
394
+ {
395
+ var errorDetails = " __tokens: '{0}', Assembly: '{1}', '{2}'" . Fmt (
396
+ accessType . Name ,
397
+ accessType . Assembly . ManifestModule . Name ,
398
+ accessType . Assembly . Location ) ;
399
+
400
+ throw new LicenseException ( ErrorMessages . UnauthorizedAccessRequest + errorDetails ) ;
401
+ }
402
+
391
403
PclExport . Instance . VerifyInAssembly ( accessType , _approved . __dlls ) ;
392
404
393
405
return new AccessToken ( requestedAccess ) ;
0 commit comments