public static FormLink Secure <T>(this FormLink <T> formLink, UserSecurityContext userSecurityContext) where T : class { if (formLink.ContextId != null) { return(userSecurityContext.CanAccess <T>(formLink.ContextId.Value) ? formLink : formLink.AsText()); } return(userSecurityContext.CanAccess <T>() ? formLink : formLink.AsText()); }