public void EnqueuePackage(IProcessPackage package) { IIdentity identity = package.LocalConfiguration <IIdentity>("enqueueUser"); if (!CheckAuthenticatedUser(identity)) { throw new InvalidOperationException("You are not authorized to perform the demanded Action"); } if (package is TPackage) { EnqueuePackage((TPackage)package); } }
public async Task <IProcessPackage> EnqueuePackage(IProcessPackage package) { IIdentity identity = package.LocalConfiguration <IIdentity>("enqueueUser"); if (!CheckAuthenticatedUser(identity)) { throw new InvalidOperationException("You are not authorized to perform the demanded Action"); } if (package is TPackage pack) { return(await EnqueuePackage(pack)); } throw new InvalidOperationException("This package type can not be processed by this Server"); }