Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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");
        }