@@ -127,7 +127,7 @@ public static class ErrorMessages
127127 internal const string ExceededServiceStackOperations = "The free-quota limit on '{0} ServiceStack Operations' has been reached." + UpgradeInstructions ;
128128 internal const string ExceededAdminUi = "The Admin UI is a commerical-only premium feature." + UpgradeInstructions ;
129129 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." ;
131131 }
132132
133133 public static class FreeQuotas
@@ -384,10 +384,22 @@ public static IDisposable RequestAccess(object accessToken, LicenseFeature srcFe
384384 {
385385 var accessType = accessToken . GetType ( ) ;
386386
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 )
389388 throw new LicenseException ( ErrorMessages . UnauthorizedAccessRequest ) ;
390389
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+
391403 PclExport . Instance . VerifyInAssembly ( accessType , _approved . __dlls ) ;
392404
393405 return new AccessToken ( requestedAccess ) ;
0 commit comments