internal bool RemoveAzureTableStoredAccessPolicy(IStorageTableManagement localChannel, string tableName, string policyName)
{
bool success = false;
string result = string.Empty;
//Get existing permissions
CloudTable table = localChannel.GetTableReference(tableName);
TablePermissions tablePermissions = localChannel.GetTablePermissions(table);
//remove the specified policy
if (!tablePermissions.SharedAccessPolicies.Keys.Contains(policyName))
{
throw new ResourceNotFoundException(String.Format(CultureInfo.CurrentCulture, Resources.PolicyNotFound, policyName));
}
if (ShouldProcess(policyName, "Remove policy"))
{
tablePermissions.SharedAccessPolicies.Remove(policyName);
localChannel.SetTablePermissions(table, tablePermissions);
success = true;
}
return success;
}