If you already have the C# logic, just wrap it in a macro function :)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CMS.MacroEngine;
using CMS.DataEngine;
using CMS.DocumentEngine;
using CMS;
using CMS.Helpers;
/// <summary>
/// Summary description for CustomMacroMethods
/// </summary>
[assembly: RegisterExtension(typeof(CustomMacroMethods), typeof(UtilNamespace))]
public class CustomMacroMethods : MacroMethodContainer
{
[MacroMethod(typeof(bool), "Determines if the Features Tab should be shown", 1)]
[MacroMethodParam(0, "nodeID", typeof(int), "The Node ID")]
public static object ShowFeaturesTab(EvaluationContext context, params object[] parameters)
{
switch (parameters.Length)
{
case 1:
var docClass = DataClassInfoProvider.GetDataClassInfo(DocumentHelper.GetDocument(ValidationHelper.GetInteger(parameters[0], -1), new TreeProvider()).ClassName);
var userQuery = XCM.FeatureDocumentTypesAllowed.Feature_DocumentTypes_AllowedInfoProvider.GetFeature_DocumentTypes_Alloweds().WhereEquals("DocumentType", docClass.ClassName);
if (userQuery.Count > 0)
{
return true;
}
else
{
return false;
}
break;
default:
throw new NotSupportedException();
}
}
}
Called by doing {% Util.ShowFeaturesTab(TheNodeID) |(identity)GlobalAdministrator%}