Narrowed down the capabilities of peer accounts within a consumer organization

This commit is contained in:
robvde 2012-09-04 15:07:38 +04:00
parent f4dfdd7b01
commit ba71e9b29c
11 changed files with 177 additions and 69 deletions

View file

@ -39,6 +39,7 @@ using System.Globalization;
using System.Text.RegularExpressions;
using System.Security.Cryptography;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal
{
@ -286,5 +287,13 @@ namespace WebsitePanel.Portal
return sb.ToString();
}
public static bool CheckQouta(string key, PackageContext cntx)
{
return cntx.Quotas.ContainsKey(key) &&
((cntx.Quotas[key].QuotaAllocatedValue == 1 && cntx.Quotas[key].QuotaTypeId == 1) ||
(cntx.Quotas[key].QuotaTypeId != 1 && (cntx.Quotas[key].QuotaAllocatedValue > 0 || cntx.Quotas[key].QuotaAllocatedValue == -1)));
}
}
}