Ejemplo n.º 1
0
 public AccountIdentifier(string accountName, bool accountIsAdmin, AccountPermissions accountPermissions, SecretKeyPermissions keyPermissions, bool isAnonymous)
 {
     this.AccountName        = accountName;
     this.IsAdmin            = accountIsAdmin;
     this.Permissions        = accountPermissions;
     this.KeyUsedPermissions = keyPermissions;
     this.IsAnonymous        = new bool?(isAnonymous);
 }
Ejemplo n.º 2
0
        public static AccountPermissions GetAccountPermissions()
        {
            var accountPermissions = new AccountPermissions()
            {
                CCProcessing = true
            };

            return(accountPermissions);
        }
Ejemplo n.º 3
0
 public AccountIdentifier(IAccountIdentifier identifier)
 {
     if (identifier == null)
     {
         throw new ArgumentNullException("src");
     }
     this.AccountName        = identifier.AccountName;
     this.Permissions        = identifier.Permissions;
     this.KeyUsedPermissions = identifier.KeyUsedPermissions;
     this.IsAnonymous        = identifier.IsAnonymous;
 }
Ejemplo n.º 4
0
 public AccountIdentifier(IStorageAccount account, SecretKeyPermissions keyUsedPermissions)
 {
     if (account == null)
     {
         throw new ArgumentNullException("account", "account cannot be null");
     }
     NephosAssertionException.Assert(account.Permissions.HasValue, "account.Permissions cannot be null");
     this.AccountName        = account.Name;
     this.IsSecondaryAccess  = account.IsSecondaryAccess;
     this.Permissions        = account.Permissions.Value;
     this.KeyUsedPermissions = keyUsedPermissions;
 }
Ejemplo n.º 5
0
 public override void ConfigureServices(ServiceConfigurationContext context)
 {
     context.Services.AddAuthorization(options =>
     {
         foreach (var item in AccountPermissions.GetAll())
         {
             options.AddPolicy(item, policy =>
             {
                 policy.RequireClaim("permisson", item);
             });
         }
     });
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Returns true if permission contains all permissions passed in.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="requiredPermissions"></param>
        /// <returns></returns>
        public static bool HasAllPermissions(this AccountPermissions value, params AccountPermissions[] requiredPermissions)
        {
            var hasPermission = true;

            foreach (var item in requiredPermissions)
            {
                if (!value.HasFlag(item))
                {
                    hasPermission = false;
                    break;
                }
            }

            return(hasPermission);
        }
Ejemplo n.º 7
0
        private void HydrateAccountPermissions(ElementTree xml, Element xmlTrans, AccountPermissions accountPermissions)
        {
            if (accountPermissions.ACHIn != null)
            {
                xml.SubElement(xmlTrans, "ACHIn", accountPermissions.ACHIn == true ? "Y" : "N");
            }
            if (accountPermissions.ACHOut != null)
            {
                xml.SubElement(xmlTrans, "ACHOut", accountPermissions.ACHOut == true ? "Y" : "N");
            }
            if (accountPermissions.CCProcessing != null)
            {
                xml.SubElement(xmlTrans, "CCProcessing", accountPermissions.CCProcessing == true ? "Y" : "N");
            }
            if (accountPermissions.ProPayIn != null)
            {
                xml.SubElement(xmlTrans, "ProPayIn", accountPermissions.ProPayIn == true ? "Y" : "N");
            }
            if (accountPermissions.ProPayOut != null)
            {
                xml.SubElement(xmlTrans, "ProPayOut", accountPermissions.ProPayOut == true ? "Y" : "N");
            }

            xml.SubElement(xmlTrans, "CreditCardMonthLimit", accountPermissions.CreditCardMonthLimit);
            xml.SubElement(xmlTrans, "CreditCardTransactionLimit", accountPermissions.CreditCardTransactionLimit);
            xml.SubElement(xmlTrans, "MerchantOverallStatus", accountPermissions.MerchantOverallStatus.ToString());

            if (accountPermissions.SoftLimitEnabled != null)
            {
                xml.SubElement(xmlTrans, "SoftLimitEnabled", accountPermissions.SoftLimitEnabled == true ? "Y" : "N");
            }
            if (accountPermissions.ACHPaymentSoftLimitEnabled != null)
            {
                xml.SubElement(xmlTrans, "AchPaymentSoftLimitEnabled", accountPermissions.ACHPaymentSoftLimitEnabled == true ? "Y" : "N");
            }

            xml.SubElement(xmlTrans, "SoftLimitAchOffPercent", accountPermissions.SoftLimitACHOffPercent);
            xml.SubElement(xmlTrans, "AchPaymentAchOffPercent", accountPermissions.ACHPaymentACHOffPercent);
        }
Ejemplo n.º 8
0
 public AccountIdentifier(string accountName, bool accountIsAdmin, AccountPermissions accountPermissions) : this(accountName, accountIsAdmin, accountPermissions, SecretKeyPermissions.Full, false)
 {
 }
Ejemplo n.º 9
0
 private void JustDecompileGenerated_set_Permissions(AccountPermissions value)
 {
     this.JustDecompileGenerated_Permissions_k__BackingField = value;
 }
Ejemplo n.º 10
0
 public SignedAccessAccountIdentifier(string accountName, bool accountIsAdmin, AccountPermissions accountPermissions, SASPermission signedAccessPermission, List <SASAccessRestriction> signedAccessRestrictions) : base(accountName, accountIsAdmin, accountPermissions)
 {
     this.SignedAccessPermission   = signedAccessPermission;
     this.SignedAccessRestrictions = signedAccessRestrictions;
     this.SignedProtocol           = SasProtocol.All;
 }
Ejemplo n.º 11
0
 private CommonUserAccount CreateCommonUserAccount(Guid accountId, Guid userId, AccountPermissions permissions)
 {
     return(new CommonUserAccount
     {
         AccountId = accountId,
         UserId = userId,
         Permissions = permissions
     });
 }
Ejemplo n.º 12
0
 public PayFacBuilder WithAccountPermissions(AccountPermissions accountPermissions)
 {
     AccountPermissions = accountPermissions;
     return(this);
 }
Ejemplo n.º 13
0
 protected AccountAccessRulesIdentifier(string accountName, bool accountIsAdmin, AccountPermissions accountPermissions) : base(accountName, accountIsAdmin, accountPermissions, SecretKeyPermissions.Full, false)
 {
 }
Ejemplo n.º 14
0
 protected AccountAccessRulesIdentifier(string accountName, bool accountIsAdmin, AccountPermissions accountPermissions, SecretKeyPermissions keyPermissions, bool isAnonymous) : base(accountName, accountIsAdmin, accountPermissions, keyPermissions, isAnonymous)
 {
 }